diff --git a/app/controller/api/store/product/CloudWarehouse.php b/app/controller/api/store/product/CloudWarehouse.php index 70c0129a..cd9e491b 100644 --- a/app/controller/api/store/product/CloudWarehouse.php +++ b/app/controller/api/store/product/CloudWarehouse.php @@ -51,11 +51,13 @@ class CloudWarehouse extends BaseController $search = [ 'street_id' => $params['street_code'], 'type_id' => $typeTownSupplyChainId, - 'category_id' => $params['category_id'], 'status' => 1, 'is_del' => 0, 'mer_state' => 1, ]; + if (!empty($params['category_id'])) { + $search['category_id'] = $params['category_id']; + } $merchantIds = $this->merchantDao->search($search)->column('mer_id'); [$page, $limit] = $this->getPage(); if (empty($merchantIds)) { @@ -65,11 +67,13 @@ class CloudWarehouse extends BaseController $entryWhere = [ 'street_id' => $params['street_code'], 'type_id' => $typeCloudWarehouseId, - 'category_id' => $params['category_id'], '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['keyword'] = $params['keyword']; $where['mer_ids'] = $merchantIds;