From bbabc71f82ec8194b91f3bfe67f6345951f1634c Mon Sep 17 00:00:00 2001 From: vine_liutk <961510893@qq.com> Date: Thu, 14 Apr 2022 13:30:51 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=A0=8D=E4=BB=B7=E4=B8=8B?= =?UTF-8?q?=E5=8D=95=E8=AE=A1=E7=AE=97=E4=BC=98=E6=83=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Services/OrderService.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/Services/OrderService.php b/app/Services/OrderService.php index 4b571251..dccf3c7e 100644 --- a/app/Services/OrderService.php +++ b/app/Services/OrderService.php @@ -863,9 +863,12 @@ class OrderService foreach ($amounts as &$amount) { $i--; + $originalAmount = $amount; + if ($i > 0) { $amount = (int) bcdiv(bcmul($bargainAmount, $amount, 0), $totalAmount, 2); $bargainAmount -= $amount; + $totalAmount -= $originalAmount; } else { $amount = $bargainAmount; }