调试平台手续费分润
This commit is contained in:
parent
dbdf1028da
commit
67ef396a88
@ -46,6 +46,7 @@ class paySuccessOrder
|
|||||||
$commission_rate = ($event['order']['commission_rate'] / 100);
|
$commission_rate = ($event['order']['commission_rate'] / 100);
|
||||||
//该笔订单平台总手续费
|
//该笔订单平台总手续费
|
||||||
$this->totalAmount = bcmul((string)$item['total'], (string)$commission_rate, 2);
|
$this->totalAmount = bcmul((string)$item['total'], (string)$commission_rate, 2);
|
||||||
|
$this->remain = $this->totalAmount;
|
||||||
if ($this->totalAmount <= 0) {
|
if ($this->totalAmount <= 0) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -57,7 +58,7 @@ class paySuccessOrder
|
|||||||
$merchantRate = systemConfig('commission_to_merchant_rate');
|
$merchantRate = systemConfig('commission_to_merchant_rate');
|
||||||
$merchantAmount = bcmul($this->totalAmount, (string)($merchantRate / 100), 2);
|
$merchantAmount = bcmul($this->totalAmount, (string)($merchantRate / 100), 2);
|
||||||
if ($merchantAmount > 0) {
|
if ($merchantAmount > 0) {
|
||||||
$this->remain = bcsub($this->totalAmount, $merchantAmount, 2);
|
$this->remain = bcsub($this->remain, $merchantAmount, 2);
|
||||||
$this->finance[] = [
|
$this->finance[] = [
|
||||||
'order_id' => $this->event['order']['order_id'],
|
'order_id' => $this->event['order']['order_id'],
|
||||||
'order_sn' => $this->event['order']['order_sn'],
|
'order_sn' => $this->event['order']['order_sn'],
|
||||||
@ -132,7 +133,7 @@ class paySuccessOrder
|
|||||||
'commission_to_cloud_rate' => 'cloud_warehouse',
|
'commission_to_cloud_rate' => 'cloud_warehouse',
|
||||||
];
|
];
|
||||||
$amount = bcmul($this->totalAmount, (string)($rate / 100), 2);
|
$amount = bcmul($this->totalAmount, (string)($rate / 100), 2);
|
||||||
$this->remain = bcsub($this->totalAmount, $amount, 2);
|
$this->remain = bcsub($this->remain, $amount, 2);
|
||||||
$this->finance[] = [
|
$this->finance[] = [
|
||||||
'order_id' => $this->event['order']['order_id'],
|
'order_id' => $this->event['order']['order_id'],
|
||||||
'order_sn' => $this->event['order']['order_sn'],
|
'order_sn' => $this->event['order']['order_sn'],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user