修改分佣的错误
This commit is contained in:
parent
1ba676c6cd
commit
d764835d73
@ -42,8 +42,8 @@ class paySuccessOrder
|
|||||||
$commission_rate = ($event['order']['commission_rate'] / 100);
|
$commission_rate = ($event['order']['commission_rate'] / 100);
|
||||||
//该笔订单平台总手续费
|
//该笔订单平台总手续费
|
||||||
$this->totalAmount = bcmul((string)$event['order']['total_price'], (string)$commission_rate, 2);
|
$this->totalAmount = bcmul((string)$event['order']['total_price'], (string)$commission_rate, 2);
|
||||||
$this->totalAmount = bcmul($this->totalAmount, (string)$event['order']['extension_one'], 2);
|
$this->totalAmount = bcsub($this->totalAmount, (string)$event['order']['extension_one'], 2);
|
||||||
$this->totalAmount = bcmul($this->totalAmount, (string)$event['order']['extension_two'], 2);
|
$this->totalAmount = bcsub($this->totalAmount, (string)$event['order']['extension_two'], 2);
|
||||||
$this->remain = $this->totalAmount;
|
$this->remain = $this->totalAmount;
|
||||||
|
|
||||||
//镇团队佣金
|
//镇团队佣金
|
||||||
@ -59,11 +59,11 @@ class paySuccessOrder
|
|||||||
->where('is_refund', 0)
|
->where('is_refund', 0)
|
||||||
->whereIn('source', [StoreCartDao::SOURCE_STORE_CLOUD, StoreCartDao::SOURCE_CLOUD])
|
->whereIn('source', [StoreCartDao::SOURCE_STORE_CLOUD, StoreCartDao::SOURCE_CLOUD])
|
||||||
->group('source_id')
|
->group('source_id')
|
||||||
->column('source,source_id,sum(product_price) total');
|
->column('source,source_id,sum(product_price) total,extension_one,extension_two');
|
||||||
foreach ($orderProduct as $item) {
|
foreach ($orderProduct as $item) {
|
||||||
$this->totalAmount = bcmul((string)$item['total'], (string)$commission_rate, 2);
|
$this->totalAmount = bcmul((string)$item['total'], (string)$commission_rate, 2);
|
||||||
$this->totalAmount = bcmul($this->totalAmount, (string)$item['extension_one'], 2);
|
$this->totalAmount = bcsub($this->totalAmount, (string)$item['extension_one'], 2);
|
||||||
$this->totalAmount = bcmul($this->totalAmount, (string)$item['extension_two'], 2);
|
$this->totalAmount = bcsub($this->totalAmount, (string)$item['extension_two'], 2);
|
||||||
if ($this->totalAmount <= 0) {
|
if ($this->totalAmount <= 0) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user