From 944aaf24254fdbc46896bf68321be789fb9e4d07 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Wed, 11 Dec 2024 17:58:53 +0800 Subject: [PATCH] =?UTF-8?q?refactor(order):=20=E4=BF=AE=E6=94=B9=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E9=80=BB=E8=BE=91=E4=B8=AD=E7=9A=84=E5=95=86=E5=93=81?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将 StoreBranchProduct 模型中的 is_show 字段改为 status 字段 - 将 StoreProductGroupPrice 模型中的 status 字段改为 is_show 字段 - 优化了商品下架状态的判断逻辑,提高代码的可读性和一致性 --- app/api/logic/order/OrderLogic.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/api/logic/order/OrderLogic.php b/app/api/logic/order/OrderLogic.php index 29aff2b68..0f9fe614a 100644 --- a/app/api/logic/order/OrderLogic.php +++ b/app/api/logic/order/OrderLogic.php @@ -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('订单存在下架商品请更换后下单'); } }