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'],