This commit is contained in:
mkm 2024-01-12 15:25:20 +08:00
parent fe73347f35
commit bda69231bc

View File

@ -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;