diff --git a/app/common/repositories/store/product/SpuRepository.php b/app/common/repositories/store/product/SpuRepository.php index 33cbf4bb..4a1fa59b 100644 --- a/app/common/repositories/store/product/SpuRepository.php +++ b/app/common/repositories/store/product/SpuRepository.php @@ -192,7 +192,6 @@ class SpuRepository extends BaseRepository unset($where['mer_id'], $where['page']); $page = 1; } - $entryMerId = $where['entry_mer_id'] ?? ''; unset($where['entry_mer_id']); $query = $this->dao->search($where); diff --git a/app/controller/api/store/product/CloudWarehouse.php b/app/controller/api/store/product/CloudWarehouse.php index cd9e491b..d41e1f55 100644 --- a/app/controller/api/store/product/CloudWarehouse.php +++ b/app/controller/api/store/product/CloudWarehouse.php @@ -63,18 +63,21 @@ class CloudWarehouse extends BaseController if (empty($merchantIds)) { return app('json')->success(['count' => 0, 'list' => []]); } - $typeCloudWarehouseId = Db::name('MerchantType')->where('type_code', Merchant::TypeCode['TypeCloudWarehouse'])->value('mer_type_id'); - $entryWhere = [ - 'street_id' => $params['street_code'], - 'type_id' => $typeCloudWarehouseId, - 'status' => 1, - 'is_del' => 0, - 'mer_state' => 1, - ]; - if (!empty($params['category_id'])) { - $entryWhere['category_id'] = $params['category_id']; - } - $where['entry_mer_id'] = $this->merchantDao->search($entryWhere)->value('mer_id'); + // 隐藏镇级云仓 + // $typeCloudWarehouseId = Db::name('MerchantType')->where('type_code', Merchant::TypeCode['TypeCloudWarehouse'])->value('mer_type_id'); + // $entryWhere = [ + // 'street_id' => $params['street_code'], + // 'type_id' => $typeCloudWarehouseId, + // 'status' => 1, + // 'is_del' => 0, + // 'mer_state' => 1, + // ]; + // if (!empty($params['category_id'])) { + // $entryWhere['category_id'] = $params['category_id']; + // } + // $where['entry_mer_id'] = $this->merchantDao->search($entryWhere)->value('mer_id'); + + $where['entry_mer_id'] = 0; $where['keyword'] = $params['keyword']; $where['mer_ids'] = $merchantIds; $where['product_type'] = $params['product_type']; diff --git a/app/controller/api/store/product/StoreSpu.php b/app/controller/api/store/product/StoreSpu.php index 99cd2801..83eda5f7 100644 --- a/app/controller/api/store/product/StoreSpu.php +++ b/app/controller/api/store/product/StoreSpu.php @@ -144,17 +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(); $typeTownSupplyChainId = Db::name('MerchantType')->where('type_code', Merchant::TypeCode['TypeTownSupplyChain'])->value('mer_type_id'); - $where['mer_array_id'][] = $id; - $mer_id = Db::name('merchant') + $merIdArray = Db::name('merchant') ->where('street_id',$currentMerchant['street_id']) ->where('mer_state',1) ->where('status',1) ->where('category_id',$currentMerchant['category_id']) ->where('type_id', $typeTownSupplyChainId) - ->value('mer_id'); - if ($mer_id) { - $where['mer_array_id'][] = $mer_id; - } + ->column('mer_id'); + $where['mer_array_id'] = $merIdArray; // $where['mer_id'] = $mer_id; $where['entry_mer_id'] = $id; $where['is_gift_bag'] = 0;