From f3e83cda79a5590ae7138a8f1ad0617b674f3d10 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Fri, 12 Jul 2024 13:52:12 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BF=AE=E6=94=B9=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E9=80=BB=E8=BE=91=EF=BC=8C=E5=A2=9E=E5=8A=A0=E7=94=9F=E9=B2=9C?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E8=AE=A2=E5=8D=95=E9=87=91=E9=A2=9D=E5=A4=A7?= =?UTF-8?q?=E4=BA=8E200=E5=85=83=E7=9A=84=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/logic/order/OrderLogic.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/app/api/logic/order/OrderLogic.php b/app/api/logic/order/OrderLogic.php index 2c5c0664..f5e24b89 100644 --- a/app/api/logic/order/OrderLogic.php +++ b/app/api/logic/order/OrderLogic.php @@ -130,7 +130,7 @@ class OrderLogic extends BaseLogic } //计算生鲜 if ($createOrder == 1 && $find['top_cate_id'] == 15201) { - $fresh_price=bcadd($fresh_price,$cart_select[$k]['pay_price']); + $fresh_price = bcadd($fresh_price, $cart_select[$k]['pay_price']); } $cart_select[$k]['product_id'] = $find['product_id']; $cart_select[$k]['old_cart_id'] = $v['id']; @@ -172,14 +172,15 @@ class OrderLogic extends BaseLogic // $pay_price = self::$pay_price; // } else { + + $pay_price = bcsub(self::$pay_price, self::$activity_price, 2); //减去活动优惠金额 //判断生鲜是否大于200 - if($createOrder==1 && $fresh_price>0){ - if($fresh_price<200){ - self::setError('订单里的生鲜必须大于金额200元'); + if ($createOrder == 1 && $fresh_price > 0) { + if ($pay_price < 200) { + self::setError('订单包含生鲜产品,订单金额必须大于200元,才能下单'); return false; } } - $pay_price = bcsub(self::$pay_price, self::$activity_price, 2); //减去活动优惠金额 // } //成本价 收益 $order = [ @@ -263,7 +264,7 @@ class OrderLogic extends BaseLogic $params['order_id'] = $order_id; $params['verify_code'] = $verify_code; $orderInfo = self::cartIdByOrderInfo($cartId, $addressId, $user, $params, 1); - if($orderInfo==false){ + if ($orderInfo == false) { self::setError(self::getError()); return false; }