From 66621b512f0d98bfd6209c3cb11f0305a3413069 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Sat, 13 Jul 2024 09:31:36 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat(OrderLogic):=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E9=80=BB=E8=BE=91=EF=BC=8C=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E6=88=90=E6=9C=AC=E8=AE=A1=E7=AE=97=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/logic/order/OrderLogic.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/api/logic/order/OrderLogic.php b/app/api/logic/order/OrderLogic.php index e57deb27..97b53fde 100644 --- a/app/api/logic/order/OrderLogic.php +++ b/app/api/logic/order/OrderLogic.php @@ -70,7 +70,7 @@ class OrderLogic extends BaseLogic self::setError('购物车为空'); return false; } - try { + // try { self::$total_price = 0; self::$pay_price = 0; self::$cost = 0; //成本由采购价替代原成本为门店零售价 @@ -94,7 +94,7 @@ class OrderLogic extends BaseLogic } unset($cart_select[$k]['id']); $cart_select[$k]['total_price'] = bcmul($v['cart_num'], $find['price'], 2); //订单总价 - if ($off_activity == 1 || in_array($user['user_ship'], [4, 5, 6, 7])) { + if ($off_activity == 1 || ($user!=null &&in_array($user['user_ship'], [4, 5, 6, 7]))) { $price = $find['cost']; } else { $price = $find['price']; @@ -218,10 +218,10 @@ class OrderLogic extends BaseLogic } } } - } catch (\Exception $e) { - self::setError($e->getMessage()); - return false; - } + // } catch (\Exception $e) { + // self::setError($e->getMessage()); + // return false; + // } return ['order' => $order, 'cart_list' => $cart_select, 'shopInfo' => $store['near_store']]; } From d7fd07238f0629989404ee6d0b14cda94fcbbf7c Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Sat, 13 Jul 2024 09:32:26 +0800 Subject: [PATCH 2/2] 1 --- app/api/logic/order/OrderLogic.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/api/logic/order/OrderLogic.php b/app/api/logic/order/OrderLogic.php index 97b53fde..a0fa3836 100644 --- a/app/api/logic/order/OrderLogic.php +++ b/app/api/logic/order/OrderLogic.php @@ -70,7 +70,7 @@ class OrderLogic extends BaseLogic self::setError('购物车为空'); return false; } - // try { + try { self::$total_price = 0; self::$pay_price = 0; self::$cost = 0; //成本由采购价替代原成本为门店零售价 @@ -218,10 +218,10 @@ class OrderLogic extends BaseLogic } } } - // } catch (\Exception $e) { - // self::setError($e->getMessage()); - // return false; - // } + } catch (\Exception $e) { + self::setError($e->getMessage()); + return false; + } return ['order' => $order, 'cart_list' => $cart_select, 'shopInfo' => $store['near_store']]; }