更新状态查询

This commit is contained in:
yaooo 2023-09-04 13:08:13 +08:00
parent e95dd996f6
commit ccbd53a895
4 changed files with 8 additions and 5 deletions

View File

@ -143,12 +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');
$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',Merchant::TypeCloudWarehouse)
->where('type_id', $typeCloudWarehouseId)
->value('mer_id');
if (!$mer_id) {
return app('json')->success(['count'=>0,'list'=>[]]);

View File

@ -18,6 +18,7 @@ class CloudProduct
{
$productIds = $event['product_id'];
$typeStoreId = Db::name('MerchantType')->where('type_code', Merchant::TypeCode['TypeStore'])->value('mer_type_id');
$typeCloudWarehouseId = Db::name('MerchantType')->where('type_code', Merchant::TypeCode['TypeCloudWarehouse'])->value('mer_type_id');
$products = Product::withTrashed()->whereIn('product_id', $productIds)->field('product_id,mer_id,status,is_del,is_show,mer_status,is_used')->select();
/** @var CloudProductDao $repo */
$repo = app()->make(CloudProductDao::class);
@ -29,7 +30,7 @@ class CloudProduct
if (!$categoryId) {
continue;
}
$cloudMerchant = Merchant::getDB()->where(['type_id' => Merchant::TypeCloudWarehouse, 'category_id' => $categoryId, 'status' => 1, 'mer_state' => 1])->value('mer_id');
$cloudMerchant = Merchant::getDB()->where(['type_id' => $typeCloudWarehouseId, 'category_id' => $categoryId, 'status' => 1, 'mer_state' => 1])->value('mer_id');
if (empty($cloudMerchant)) {
continue;
}

View File

@ -19,7 +19,8 @@ class ProductCreate
if (empty($merchant)) {
return false;
}
if ($merchant['type_id'] == Merchant::TypePlatform || $merchant['type_id'] == Merchant::TypeCloudWarehouse) {
$typeCloudWarehouseId = Db::name('MerchantType')->where('type_code', Merchant::TypeCode['TypeCloudWarehouse'])->value('mer_type_id');
if ($merchant['type_id'] == Merchant::TypePlatform || $merchant['type_id'] == $typeCloudWarehouseId) {
return false;
}

View File

@ -104,9 +104,9 @@ class paySuccessOrder
}
}
}
$typeCloudWarehouseId = Db::name('MerchantType')->where('type_code', Merchant::TypeCode['TypeCloudWarehouse'])->value('mer_type_id');
//云仓佣金
$this->calculate(Merchant::TypeCloudWarehouse, 'commission_to_cloud_rate');
$this->calculate($TypeCloudWarehouse, 'commission_to_cloud_rate');
}
if ($this->remain > 0) {