更新商品查询

This commit is contained in:
yaooo 2023-09-27 09:57:38 +08:00
parent e4152f9e02
commit 0758f934e4
3 changed files with 18 additions and 19 deletions

View File

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

View File

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

View File

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