调试平台手续费分润
This commit is contained in:
parent
67ef396a88
commit
246541b9d7
@ -35,6 +35,18 @@ class paySuccessOrder
|
||||
}
|
||||
$this->streetId = $merchant['street_id'];
|
||||
|
||||
$commission_rate = ($event['order']['commission_rate'] / 100);
|
||||
//该笔订单平台总手续费
|
||||
$this->totalAmount = bcmul((string)$event['order']['total_price'], (string)$commission_rate, 2);
|
||||
$this->remain = $this->totalAmount;
|
||||
|
||||
//镇团队佣金
|
||||
$this->calculate(Merchant::TypeTownServer, 'commission_to_town_rate');
|
||||
//村团队佣金
|
||||
$this->calculate(Merchant::TypeVillageServer, 'commission_to_village_rate');
|
||||
//小组服务团队佣金
|
||||
$this->calculate(Merchant::TypeTeamServer, 'commission_to_service_team_rate');
|
||||
|
||||
//订单购物详情表是否有云仓数据
|
||||
$orderProduct = Db::name('store_order_product')
|
||||
->where('order_id', $event['order']['order_id'])
|
||||
@ -43,10 +55,7 @@ class paySuccessOrder
|
||||
->group('source_id')
|
||||
->column('source,source_id,sum(product_price) total');
|
||||
foreach ($orderProduct as $item) {
|
||||
$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;
|
||||
}
|
||||
@ -86,12 +95,6 @@ class paySuccessOrder
|
||||
}
|
||||
}
|
||||
|
||||
//镇团队佣金
|
||||
$this->calculate(Merchant::TypeTownServer, 'commission_to_town_rate');
|
||||
//村团队佣金
|
||||
$this->calculate(Merchant::TypeVillageServer, 'commission_to_village_rate');
|
||||
//小组服务团队佣金
|
||||
$this->calculate(Merchant::TypeTeamServer, 'commission_to_service_team_rate');
|
||||
//云仓佣金
|
||||
$this->calculate(Merchant::TypeCloudWarehouse, 'commission_to_cloud_rate');
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user