From 2209bac2f07b35d19df6057e479858386b1031c2 Mon Sep 17 00:00:00 2001 From: yaooo <272523191@qq.com> Date: Thu, 28 Sep 2023 13:04:14 +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 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/controller/api/store/product/StoreSpu.php b/app/controller/api/store/product/StoreSpu.php index 2dfb5754..ac2b4975 100644 --- a/app/controller/api/store/product/StoreSpu.php +++ b/app/controller/api/store/product/StoreSpu.php @@ -64,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()->whereNotIn('type_id', $implode(',', $typeIdArray ?? []))->where(['status' => 1, 'mer_state' => 1, 'is_del' => 0])->column('mer_id'); + $where['mer_ids'] = Merchant::getInstance()->whereIn('type_id', implode(',', $typeIdArray ?? []))->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); return app('json')->success($data); @@ -100,7 +100,7 @@ class StoreSpu extends BaseController $where['is_gift_bag'] = 0; $where['product_type'] = 0; $where['order'] = $where['order'] ?: 'star'; - $where['mer_ids'] = Merchant::getInstance()->whereNotIn('type_id', $implode(',', $typeIdArray ?? []))->where('street_id', $id) + $where['mer_ids'] = Merchant::getInstance()->whereIn('type_id', implode(',', $typeIdArray ?? []))->where('street_id', $id) ->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); @@ -144,14 +144,14 @@ class StoreSpu extends BaseController if ($where['action']) unset($where['product_type']); $currentMerchant = Db::name('merchant')->where('mer_id',$id)->field('category_id,street_id')->find(); $typeIdArray = Db::name('MerchantType')->whereNotIn('type_code', Merchant::TypeCode['TypeCloudWarehouse'] . ',' .Merchant::TypeCode['TypeSupplyChain'])->column('mer_type_id'); + $merIdArray = Db::name('merchant') ->where('street_id',$currentMerchant['street_id']) ->where('mer_state',1) ->where('status',1) ->where('category_id',$currentMerchant['category_id']) - ->whereNotIn('type_id', $implode(',', $typeIdArray ?? [])) + ->whereIn('type_id', implode(',', $typeIdArray)) ->column('mer_id'); - $where['mer_array_id'] = $merIdArray; $where['mer_rand_id'] = $id; $where['entry_mer_id'] = $id; @@ -196,7 +196,7 @@ class StoreSpu extends BaseController } $where['product_type'] = 0; $where['is_stock'] = 1; - $where['mer_ids'] = Merchant::getInstance()->whereNotIn('type_id', $implode(',', $typeIdArray ??[])) + $where['mer_ids'] = Merchant::getInstance()->whereIn('type_id', implode(',', $typeIdArray ??[])) ->where(['status' => 1, 'mer_state' => 1, 'is_del' => 0])->column('mer_id'); $data = $this->repository->getApiSearch($where, $page, $limit, $this->userInfo); return app('json')->success($data);