Merge pull request 'fix(order): 检查订单商品是否下架' (#380) from dev into main
Reviewed-on: #380
This commit is contained in:
commit
acedd0f8d6
@ -100,11 +100,17 @@ class OrderLogic extends BaseLogic
|
|||||||
if ($source == 2) {
|
if ($source == 2) {
|
||||||
$field = 'product_id,product_id id,store_name,image,unit,price,vip_price,cost,purchase,cate_id,store_info,rose';
|
$field = 'product_id,product_id id,store_name,image,unit,price,vip_price,cost,purchase,cate_id,store_info,rose';
|
||||||
$find = StoreBranchProduct::where(['product_id' => $v['product_id'], 'store_id' => $params['store_id']])->field($field)->find();
|
$find = StoreBranchProduct::where(['product_id' => $v['product_id'], 'store_id' => $params['store_id']])->field($field)->find();
|
||||||
|
if($find && $find['is_show']==0){
|
||||||
|
throw new BusinessException('订单存在下架商品请更换后下单');
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$find = StoreProduct::where(['id' => $v['product_id']])->field($field)->find();
|
$find = StoreProduct::where(['id' => $v['product_id']])->field($field)->find();
|
||||||
if (!empty($user['user_ship'])) {
|
if (!empty($user['user_ship'])) {
|
||||||
$find = StoreProductGroupPrice::resetProductPrice($find, $user['user_ship']);
|
$find = StoreProductGroupPrice::resetProductPrice($find, $user['user_ship']);
|
||||||
}
|
}
|
||||||
|
if($find && $find['status']==0){
|
||||||
|
throw new BusinessException('订单存在下架商品请更换后下单');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!$find) {
|
if (!$find) {
|
||||||
throw new BusinessException('商品不存在');
|
throw new BusinessException('商品不存在');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user