Browse Source

Merge branch 'phoenix' into master

master
weigang 5 years ago
parent
commit
04d51f8278
  1. 9
      app/Service/SeparateAccountsService.php

9
app/Service/SeparateAccountsService.php

@ -193,6 +193,7 @@ class SeparateAccountsService implements SeparateAccountsServiceInterface
$mpInfo = MpInfo::query()->find($market->mp_id); // 服务商
if (empty($mpInfo)) continue;
// $ssdbName = 'mm_'.$mmInfo->id.'_award_'.$store->id;
$ssdbName = 'mm_'.$mpInfo->id.'_award_'.$store->id;
// TODO 暂时在这里初始化
@ -226,14 +227,16 @@ class SeparateAccountsService implements SeparateAccountsServiceInterface
$this->financialRecordService->mpAwardByNewStore($mpInfo->admin_user_id, $global_order_id, $MmMpAwardConfig['mp_new_store'], '发展新商户【'.$store->name.'】'); // 服务商新商户奖励
}
}
// 线上订单服务商分账
if ($orderMain->type == OrderMain::ORDER_TYPE_ONLINE) {
$money = bcmul($orderMain->money, bcdiv($MmMpAwardConfig['separate_rate'], 100, 6), 2);
$rate = bcdiv($order['money'], $orderMain->total_money, 6);
$preMoney = bcmul($orderMain->money, $rate, 6);
$money = bcmul($preMoney, bcdiv($MmMpAwardConfig['separate_rate'], 100, 6), 2);
$this->financialRecordService->mpSeparateAccountByOLOrderComp($mpInfo->admin_user_id, $global_order_id, $money);
}
}
// =======服务商、市场经理奖励分账 / End=======
Db::commit();

Loading…
Cancel
Save