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 != '') {