refactor(order): 修改订单逻辑中的商品状态判断

- 将 StoreBranchProduct 模型中的 is_show 字段改为 status 字段
- 将 StoreProductGroupPrice 模型中的 status 字段改为 is_show 字段
- 优化了商品下架状态的判断逻辑,提高代码的可读性和一致性
This commit is contained in:
mkm 2024-12-11 17:58:53 +08:00
parent 7d6049fbf7
commit 944aaf2425

View File

@ -100,7 +100,7 @@ class OrderLogic extends BaseLogic
if ($source == 2) {
$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();
if($find && $find['is_show']==0){
if($find && $find['status']==0){
throw new BusinessException('订单存在下架商品请更换后下单');
}
} else {
@ -108,7 +108,7 @@ class OrderLogic extends BaseLogic
if (!empty($user['user_ship'])) {
$find = StoreProductGroupPrice::resetProductPrice($find, $user['user_ship']);
}
if($find && $find['status']==0){
if($find && $find['is_show']==0){
throw new BusinessException('订单存在下架商品请更换后下单');
}
}