From 320aca8cfcdb7612c4cbe15a975af4efdada730a Mon Sep 17 00:00:00 2001 From: wucongxing8150 <815046773@qq.com> Date: Wed, 8 May 2024 08:53:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=E4=BC=98=E6=83=A0=E9=87=91?= =?UTF-8?q?=E9=A2=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Services/PatientOrderService.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/Services/PatientOrderService.php b/app/Services/PatientOrderService.php index 724b65c..a6dd807 100644 --- a/app/Services/PatientOrderService.php +++ b/app/Services/PatientOrderService.php @@ -646,6 +646,13 @@ class PatientOrderService extends BaseService } } + // 处理优惠金额 + $order_product['discount_amount'] = bcsub( + (string)$order_product['amount_total'], + (string)$order_product['payment_amount_total'], + 2 + ); + $result = array(); $result['user_doctor'] = $user_doctor ?? []; $result['order_product'] = $order_product; @@ -2269,6 +2276,9 @@ class PatientOrderService extends BaseService // 实际支付金额=商品总金额-优惠卷金额+运费金额 $payment_amount_total = bcadd(bcsub($payment_amount_total, $coupon_amount_total, 2), $logistics_fee, 2); + // 药品优惠金额 + $discount_amount = $discount_amount + $coupon_amount_total; + // 获取收货地址 $params = array(); $params['user_id'] = $user_info['user_id'];