From 67ef396a882aecafe2dc565a724bcaebcd416bf9 Mon Sep 17 00:00:00 2001 From: luofei <604446095@qq.com> Date: Fri, 26 May 2023 11:54:46 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E8=AF=95=E5=B9=B3=E5=8F=B0=E6=89=8B?= =?UTF-8?q?=E7=BB=AD=E8=B4=B9=E5=88=86=E6=B6=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/listener/paySuccessOrder.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/listener/paySuccessOrder.php b/app/listener/paySuccessOrder.php index cd4bd7c3..7c8fa643 100644 --- a/app/listener/paySuccessOrder.php +++ b/app/listener/paySuccessOrder.php @@ -46,6 +46,7 @@ class paySuccessOrder $commission_rate = ($event['order']['commission_rate'] / 100); //该笔订单平台总手续费 $this->totalAmount = bcmul((string)$item['total'], (string)$commission_rate, 2); + $this->remain = $this->totalAmount; if ($this->totalAmount <= 0) { continue; } @@ -57,7 +58,7 @@ class paySuccessOrder $merchantRate = systemConfig('commission_to_merchant_rate'); $merchantAmount = bcmul($this->totalAmount, (string)($merchantRate / 100), 2); if ($merchantAmount > 0) { - $this->remain = bcsub($this->totalAmount, $merchantAmount, 2); + $this->remain = bcsub($this->remain, $merchantAmount, 2); $this->finance[] = [ 'order_id' => $this->event['order']['order_id'], 'order_sn' => $this->event['order']['order_sn'], @@ -132,7 +133,7 @@ class paySuccessOrder 'commission_to_cloud_rate' => 'cloud_warehouse', ]; $amount = bcmul($this->totalAmount, (string)($rate / 100), 2); - $this->remain = bcsub($this->totalAmount, $amount, 2); + $this->remain = bcsub($this->remain, $amount, 2); $this->finance[] = [ 'order_id' => $this->event['order']['order_id'], 'order_sn' => $this->event['order']['order_sn'],