From 2deccdff147dd7b05b7b4b1c1ef5983845e3f72f Mon Sep 17 00:00:00 2001 From: vine_liutk <961510893@qq.com> Date: Fri, 8 Apr 2022 16:38:39 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E9=80=9A=E8=BF=87=E7=A0=8D?= =?UTF-8?q?=E4=BB=B7=E5=8D=95=E4=B8=8B=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Services/OrderService.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/Services/OrderService.php b/app/Services/OrderService.php index eef62540..a5fd887a 100644 --- a/app/Services/OrderService.php +++ b/app/Services/OrderService.php @@ -196,6 +196,11 @@ class OrderService // 订单支付金额=商品总额-券折扣金额-会员折扣金额+邮费 $totalAmount = $productsTotalAmount - $couponDiscountAmount - $vipDiscountAmount; + //如果有砍价优惠 + if ($bargainOrder) { + $totalAmount -= $bargainOrder->bargain_price; + } + if ($totalAmount < 0) { $totalAmount = 0; }