From 6d96a446ca50c2cdaffc2bb412cbacde72b0908c Mon Sep 17 00:00:00 2001 From: luofei <604446095@qq.com> Date: Sat, 3 Feb 2024 17:24:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BE=9B=E5=BA=94=E9=93=BE?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E9=87=91=E9=A2=9D=E7=9A=84=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../store/order/StoreOrderCreateRepository.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/common/repositories/store/order/StoreOrderCreateRepository.php b/app/common/repositories/store/order/StoreOrderCreateRepository.php index 1b6126a5..3689a086 100755 --- a/app/common/repositories/store/order/StoreOrderCreateRepository.php +++ b/app/common/repositories/store/order/StoreOrderCreateRepository.php @@ -447,6 +447,7 @@ class StoreOrderCreateRepository extends StoreOrderRepository } //计算单个商品实际支付金额 + $orderProcurePrice = 0; foreach ($merchantCart['list'] as $_k => &$cart) { $cartTotalPrice = bcmul($this->cartByPrice($cart), $cart['cart_num'], 2); $_cartTotalPrice = $cartTotalPrice; @@ -454,9 +455,10 @@ class StoreOrderCreateRepository extends StoreOrderRepository //单个商品实际支付金额 $cart['coupon_price'] = bcsub($_cartTotalPrice, $cartTotalPrice, 2); $cart['true_price'] = $cartTotalPrice; + $procure = $this->cartByPrice($cart, 1); + $procure_price = bcmul($cart['cart_num'], $procure, 2); + $orderProcurePrice = bcadd($orderProcurePrice, $procure_price, 2); } - $procure = $this->cartByPrice($cart, 1); - $procure_price = bcmul($cart['cart_num'], $procure, 2); unset($cart, $_k); $total_true_price = bcadd($_pay_price, $total_true_price, 2); if (count($merchantCartList) > 1 || count($merchantCart['list']) > 1) { @@ -482,7 +484,7 @@ class StoreOrderCreateRepository extends StoreOrderRepository 'delivery_status' => $deliveryStatus, 'svip_discount' => $total_svip_discount, 'use_svip' => $use_svip, - 'procure_price' => $procure_price + 'procure_price' => $orderProcurePrice ]; $order_total_postage = bcadd($order_total_postage, $postage_price, 2); $order_svip_discount = bcadd($total_svip_discount, $order_svip_discount, 2);