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;