From 1a7d6fcf0dfbdafd7ed40549da25f50f72f72021 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Wed, 8 Nov 2023 15:25:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=9F=A5=E8=AF=A2?= 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, 9 insertions(+), 5 deletions(-) diff --git a/app/controller/api/store/product/StoreSpu.php b/app/controller/api/store/product/StoreSpu.php index f8045f69..e5e4a775 100644 --- a/app/controller/api/store/product/StoreSpu.php +++ b/app/controller/api/store/product/StoreSpu.php @@ -58,17 +58,21 @@ class StoreSpu extends BaseController 'is_trader', 'product_ids', 'mer_id', - 'type_id' + 'type_id', + 'street_id' ]); if($where['type_id']){ - $where['mer_ids'] = Merchant::getInstance()->whereIn('type_id', implode(',', $where['type_id']))->where(['status' => 1, 'mer_state' => 1, 'is_del' => 0])->column('mer_id'); - }else{ - unset($where['type_id']); + $arr=['status' => 1, 'mer_state' => 1, 'is_del' => 0]; + if($where['street_id']){ + $arr['street_id']=$where['street_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']); + $where['is_gift_bag'] = 0; $where['product_type'] = 0; $where['order'] = $where['order'] ?: 'star'; - halt($where); if ($where['is_trader'] != 1) unset($where['is_trader']); $data = $this->repository->getApiSearch($where, $page, $limit, $this->userInfo); return app('json')->success($data);