更新查询镇级供应链商品

This commit is contained in:
yaooo 2023-09-26 17:08:05 +08:00
parent 7cbeceb860
commit a86527c82e
2 changed files with 6 additions and 6 deletions

View File

@ -61,10 +61,10 @@ 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');
$typeTownSupplyChainId = Db::name('MerchantType')->where('type_code', Merchant::TypeCode['TypeTownSupplyChain'])->value('mer_type_id');
$entryWhere = [
'street_id' => $params['street_code'],
'type_id' => $typeCloudWarehouseId,
'type_id' => $typeTownSupplyChainId,
'category_id' => $params['category_id'],
'status' => 1,
'is_del' => 0,

View File

@ -143,13 +143,13 @@ 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();
$typeCloudWarehouseId = Db::name('MerchantType')->where('type_code', Merchant::TypeCode['TypeCloudWarehouse'])->value('mer_type_id');
$typeTownSupplyChainId = Db::name('MerchantType')->where('type_code', Merchant::TypeCode['TypeTownSupplyChain'])->value('mer_type_id');
$mer_id = 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', $typeCloudWarehouseId)
->where('type_id', $typeTownSupplyChainId)
->value('mer_id');
if (!$mer_id) {
return app('json')->success(['count'=>0,'list'=>[]]);
@ -171,7 +171,7 @@ class StoreSpu extends BaseController
{
[$page, $limit] = $this->getPage();
$where = $this->request->params(['common','mer_id']);
$typeStoreId = Db::name('MerchantType')->where('type_code', Merchant::TypeCode['TypeStore'])->value('mer_type_id');
$typeTownSupplyChainId = Db::name('MerchantType')->where('type_code', Merchant::TypeCode['TypeTownSupplyChain'])->value('mer_type_id');
$where['is_gift_bag'] = 0;
//1:星级
//2:用户收藏
@ -197,7 +197,7 @@ class StoreSpu extends BaseController
}
$where['product_type'] = 0;
$where['is_stock'] = 1;
$where['mer_ids'] = Merchant::getInstance()->where('type_id', $typeStoreId)
$where['mer_ids'] = Merchant::getInstance()->where('type_id', $typeTownSupplyChainId)
->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);