From df99931cb51180044450d935b14685be2bfde42a Mon Sep 17 00:00:00 2001 From: chenbo <709206448@qq.com> Date: Tue, 19 Dec 2023 14:37:20 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E5=95=86=E6=88=B7=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/api/dataview/Merchant.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/controller/api/dataview/Merchant.php b/app/controller/api/dataview/Merchant.php index 65b8cae7..da746675 100644 --- a/app/controller/api/dataview/Merchant.php +++ b/app/controller/api/dataview/Merchant.php @@ -48,7 +48,13 @@ class Merchant extends BaseController $where = $this->request->params([ 'status', 'statusTag', 'is_trader', 'category_id', 'type_id', 'area_id', 'street_id']); $dao = new MerchantDao(); $query = $dao->search($where); - $count = $query->count($dao->getPk()); + $count = $query->where(function ($query) { + if ($this->streetCode != '') { + $query->where('street_id', $this->streetCode); + } else { + $query->where('area_id', $this->areaCode); + } + })->count($dao->getPk()); $list = $query->page($page, $limit)->setOption('field', []) ->where(function ($query) { if ($this->streetCode != '') {