diff --git a/app/common/dao/system/merchant/MerchantDao.php b/app/common/dao/system/merchant/MerchantDao.php index 61d4e523..7a343bc9 100644 --- a/app/common/dao/system/merchant/MerchantDao.php +++ b/app/common/dao/system/merchant/MerchantDao.php @@ -52,6 +52,10 @@ class MerchantDao extends BaseDao ->when(isset($where['is_trader']) && $where['is_trader'] !== '', function ($query) use ($where) { $query->where('is_trader', $where['is_trader']); }) + ->when(isset($where['street_id']) && $where['street_id'] !== '', function ($query) use ($where) { + $mer_id = Db::name('merchant_address')->where('street_id', $where['street_id'])->column('mer_id'); + $query->whereIn('mer_id',$mer_id ?: '' ); + }) ->when(isset($where['is_best']) && $where['is_best'] !== '', function ($query) use ($where) { $query->where('is_best', $where['is_best']); }) diff --git a/app/controller/api/store/merchant/Merchant.php b/app/controller/api/store/merchant/Merchant.php index d65a0627..ba309f0b 100644 --- a/app/controller/api/store/merchant/Merchant.php +++ b/app/controller/api/store/merchant/Merchant.php @@ -42,7 +42,7 @@ class Merchant extends BaseController public function lst() { [$page, $limit] = $this->getPage(); - $where = $this->request->params(['keyword', 'order', 'is_best', 'location', 'category_id', 'type_id','is_trader']); + $where = $this->request->params(['keyword', 'order', 'is_best', 'location', 'category_id', 'type_id','is_trader','street_id']); return app('json')->success($this->repository->getList($where, $page, $limit, $this->userInfo)); }