From 312b49b4403edded5f78f7da8666c726ce676f37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BD=AD=E6=A1=83?= <1098598843@qq.com> Date: Wed, 8 Mar 2023 17:26:39 +0800 Subject: [PATCH] =?UTF-8?q?=E5=95=86=E6=88=B7=E6=8C=89=E5=9C=B0=E5=9D=80?= =?UTF-8?q?=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/dao/system/merchant/MerchantDao.php | 4 ++++ app/controller/api/store/merchant/Merchant.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) 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)); }