From 920228fe4859a1e8444450dd84c2875ac9fe2e64 Mon Sep 17 00:00:00 2001 From: wucongxing8150 <815046773@qq.com> Date: Tue, 18 Feb 2025 11:11:17 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=8D=AF=E5=93=81?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E4=B8=AD=E8=8D=AF=E5=93=81=E5=8D=95=E4=BB=B7?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Services/PatientOrderService.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/Services/PatientOrderService.php b/app/Services/PatientOrderService.php index 017347e..04702b0 100644 --- a/app/Services/PatientOrderService.php +++ b/app/Services/PatientOrderService.php @@ -3500,6 +3500,14 @@ class PatientOrderService extends BaseService } } + foreach ($product_datas as &$product_data){ + $product_data["actual_product_price"] = bcdiv( + $product_data['actual_product_price'], + $product_data['actual_quantity'], + 2 + ); + } + return $product_datas; } } \ No newline at end of file From 5ad82a4864a58a6de2ec797a8a1fb0989fc9e097 Mon Sep 17 00:00:00 2001 From: wucongxing8150 <815046773@qq.com> Date: Tue, 18 Feb 2025 13:04:50 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E4=BA=86=E4=BC=98?= =?UTF-8?q?=E6=83=A0=E5=88=B8=E9=87=91=E9=A2=9D=E4=B8=8D=E5=8F=AF=E7=94=A8?= =?UTF-8?q?=E5=B0=8F=E6=95=B0=E7=82=B9=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Services/UserCouponService.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Services/UserCouponService.php b/app/Services/UserCouponService.php index 9a74aea..754de13 100644 --- a/app/Services/UserCouponService.php +++ b/app/Services/UserCouponService.php @@ -84,11 +84,11 @@ class UserCouponService extends BaseService /** * 获取可用优惠卷总金额 * @param array $coupons 优惠卷数据 - * @return int + * @return string */ - public function getCouponTotalPrice(array $coupons): int + public function getCouponTotalPrice(array $coupons): string { - $coupon_total_price = 0; + $coupon_total_price = "0"; foreach ($coupons as $coupon){ $coupon_total_price = bcadd($coupon_total_price,$coupon['coupon_price'],2); From defa12d98f0e0bbb661a9736ec49c849247c1a95 Mon Sep 17 00:00:00 2001 From: wucongxing8150 <815046773@qq.com> Date: Tue, 18 Feb 2025 13:15:15 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E4=BA=86=E8=8D=AF?= =?UTF-8?q?=E5=93=81=E8=AE=A2=E5=8D=95=E8=AF=A6=E6=83=85=E9=A1=B5=EF=BC=8C?= =?UTF-8?q?=E4=BC=98=E6=83=A0=E9=87=91=E9=A2=9D=E9=94=99=E8=AF=AF=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Services/PatientOrderService.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/app/Services/PatientOrderService.php b/app/Services/PatientOrderService.php index 04702b0..6d1fef8 100644 --- a/app/Services/PatientOrderService.php +++ b/app/Services/PatientOrderService.php @@ -647,7 +647,19 @@ class PatientOrderService extends BaseService } // 处理优惠金额 - $order_product['discount_amount'] = $order_product['amount_total'] + $order_product['logistics_fee'] - $order_product['coupon_amount_total'] - $order_product['payment_amount_total']; // 优惠金额 + $order_product['discount_amount'] = bcsub( + bcsub( + bcadd( + $order_product['amount_total'], + $order_product['logistics_fee'] + ,2 + ), + $order_product['coupon_amount_total'], + 2 + ), + $order_product['payment_amount_total'], + 2 + ); // 优惠金额 $result = array(); From 23d9c4dbfb7aee981e7465878f79f2bba733f5a7 Mon Sep 17 00:00:00 2001 From: wucongxing8150 <815046773@qq.com> Date: Tue, 18 Feb 2025 13:18:27 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E4=BA=86=E6=94=AF?= =?UTF-8?q?=E4=BB=98=E9=A1=B5=EF=BC=8C=E4=BC=98=E6=83=A0=E9=87=91=E9=A2=9D?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Services/PatientOrderService.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/app/Services/PatientOrderService.php b/app/Services/PatientOrderService.php index 6d1fef8..737696a 100644 --- a/app/Services/PatientOrderService.php +++ b/app/Services/PatientOrderService.php @@ -934,7 +934,20 @@ class PatientOrderService extends BaseService $result['amount_total'] = $order_product['amount_total']; // 订单金额 $result['payment_amount_total'] = $order_product['payment_amount_total']; // 实际订单金额 $result['coupon_amount_total'] = $order_product['coupon_amount_total']; // 优惠金额 - $result['discount_amount'] = $order_product['amount_total'] - $order_product['coupon_amount_total'] + $order_product['logistics_fee'] - $order_product['payment_amount_total']; // 优惠金额 + $result['discount_amount'] = + bcsub( + bcadd( + bcsub( + $order_product['amount_total'], + $order_product['coupon_amount_total'], + 2 + ), + $order_product['logistics_fee'], + 2 + ), + $order_product['payment_amount_total'], + 2 + ); // 优惠金额 // 获取优惠卷不可用原因。存在优惠卷,但是未使用-暂时废弃 /*if ($order_product['coupon_amount_total'] == 0){