From 9b0c2141f35d3164d29652d502d2038d5e874a49 Mon Sep 17 00:00:00 2001 From: yaooo <272523191@qq.com> Date: Thu, 28 Sep 2023 11:09:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=9F=A5=E8=AF=A2=E5=BC=82?= =?UTF-8?q?=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/dao/store/product/SpuDao.php | 2 +- app/controller/api/store/product/StoreSpu.php | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/common/dao/store/product/SpuDao.php b/app/common/dao/store/product/SpuDao.php index ce492e2e..425be7a1 100644 --- a/app/common/dao/store/product/SpuDao.php +++ b/app/common/dao/store/product/SpuDao.php @@ -62,7 +62,7 @@ class SpuDao extends BaseDao $query->whereIn('P.mer_id',$where['mer_array_id']); }) ->when(isset($where['mer_ids']) && $where['mer_ids'] !== '',function($query)use($where){ - // $query->whereIn('P.mer_id',$where['mer_ids']); + $query->whereIn('P.mer_id',$where['mer_ids']); }) ->when(isset($where['keyword']) && $where['keyword'] !== '',function($query)use($where){ $query->whereLike("S.store_name|S.keyword|S.product_id", "%{$where['keyword']}%"); diff --git a/app/controller/api/store/product/StoreSpu.php b/app/controller/api/store/product/StoreSpu.php index d1366b86..04538e23 100644 --- a/app/controller/api/store/product/StoreSpu.php +++ b/app/controller/api/store/product/StoreSpu.php @@ -42,7 +42,8 @@ class StoreSpu extends BaseController public function lst() { [$page, $limit] = $this->getPage(); - $typeTownSupplyChainId = Db::name('MerchantType')->where('type_code', Merchant::TypeCode['TypeTownSupplyChain'])->value('mer_type_id'); + // 除了市级供应链都可以查询 + $typeSupplyChainId = Db::name('MerchantType')->where('type_code', Merchant::TypeCode['TypeSupplyChain'])->value('mer_type_id'); $where = $this->request->params([ 'keyword', 'cate_id', @@ -63,7 +64,7 @@ class StoreSpu extends BaseController $where['is_gift_bag'] = 0; $where['product_type'] = 0; $where['order'] = $where['order'] ?: 'star'; - $where['mer_ids'] = Merchant::getInstance()->where('type_id', $typeTownSupplyChainId) + $where['mer_ids'] = Merchant::getInstance()->whereNotIn('type_id', (string)$typeSupplyChainId) ->where(['status' => 1, 'mer_state' => 1, 'is_del' => 0])->column('mer_id'); if ($where['is_trader'] != 1) unset($where['is_trader']); $data = $this->repository->getApiSearch($where, $page, $limit, $this->userInfo);