From bda69231bc2b44325465a6b45f09b25357612562 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Fri, 12 Jan 2024 15:25:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/api/store/product/StoreSpu.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/app/controller/api/store/product/StoreSpu.php b/app/controller/api/store/product/StoreSpu.php index 59fbadb0..d0d14824 100644 --- a/app/controller/api/store/product/StoreSpu.php +++ b/app/controller/api/store/product/StoreSpu.php @@ -60,16 +60,24 @@ class StoreSpu extends BaseController 'mer_id', 'type_id', 'street_id', - 'category_id' + 'category_id', + 'type_code' ]); - if ($where['type_id']) { + if ($where['type_id']||$where['type_code']) { $arr = ['status' => 1, 'mer_state' => 1, 'is_del' => 0]; if ($where['street_id']) { $arr['street_id'] = $where['street_id']; } + if($where['type_code']){ + $mer_type_id=Db::name('merchant_type')->where('type_code',$where['type_code'])->value('mer_type_id'); + if($mer_type_id){ + $where['type_id'] = $mer_type_id; + } + } $where['mer_ids'] = Merchant::getInstance()->whereIn('type_id', explode(',', $where['type_id']))->where($arr)->column('mer_id'); } - unset($where['type_id'], $where['street_id']); + + unset($where['type_id'], $where['street_id'],$where['type_code']); $where['is_gift_bag'] = 0; $where['product_type'] = $where['product_type']??0;