From 3dda5021a9ea0846e566e23515e0cc56ea1f4b22 Mon Sep 17 00:00:00 2001 From: luofei <604446095@qq.com> Date: Tue, 13 Jun 2023 14:27:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BD=A3=E9=87=91=E8=AE=A1?= =?UTF-8?q?=E7=AE=97=E7=9A=84=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/listener/paySuccessOrder.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/listener/paySuccessOrder.php b/app/listener/paySuccessOrder.php index 4ac7b704..280c310d 100644 --- a/app/listener/paySuccessOrder.php +++ b/app/listener/paySuccessOrder.php @@ -41,9 +41,9 @@ class paySuccessOrder $commission_rate = ($event['order']['commission_rate'] / 100); //该笔订单平台总手续费 - $this->totalAmount = bcmul((string)$event['order']['total_price'], (string)$commission_rate, 2); - $this->totalAmount = bcsub($this->totalAmount, (string)$event['order']['extension_one'], 2); - $this->totalAmount = bcsub($this->totalAmount, (string)$event['order']['extension_two'], 2); + $realPrice = bcsub((string)$event['order']['total_price'], (string)$event['order']['extension_one'], 2); + $realPrice = bcsub($realPrice, (string)$event['order']['extension_two'], 2); + $this->totalAmount = bcmul($realPrice, (string)$commission_rate, 2); $this->remain = $this->totalAmount; //镇团队佣金 @@ -61,9 +61,9 @@ class paySuccessOrder ->group('source_id') ->column('source,source_id,sum(product_price) total,extension_one,extension_two'); foreach ($orderProduct as $item) { - $this->totalAmount = bcmul((string)$item['total'], (string)$commission_rate, 2); - $this->totalAmount = bcsub($this->totalAmount, (string)$item['extension_one'], 2); - $this->totalAmount = bcsub($this->totalAmount, (string)$item['extension_two'], 2); + $realTotal = bcsub((string)$item['total'], (string)$item['extension_one'], 2); + $realTotal = bcsub($realTotal, (string)$item['extension_two'], 2); + $this->totalAmount = bcmul($realTotal, (string)$commission_rate, 2); if ($this->totalAmount <= 0) { continue; }