From a0c74c7b7354b96fcb0c40b2bf8fba49c088cccf Mon Sep 17 00:00:00 2001 From: weigang Date: Thu, 17 Sep 2020 10:45:54 +0800 Subject: [PATCH] =?UTF-8?q?v1=E6=9C=8D=E5=8A=A1=E5=95=86=E5=88=86=E8=B4=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Service/SeparateAccountsService.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/app/Service/SeparateAccountsService.php b/app/Service/SeparateAccountsService.php index 32d2742..c07e91c 100644 --- a/app/Service/SeparateAccountsService.php +++ b/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,12 +227,14 @@ 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) { + $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); + } - // 线上订单服务商分账 - if ($orderMain->type == OrderMain::ORDER_TYPE_ONLINE) { - $money = bcmul($orderMain->money, bcdiv($MmMpAwardConfig['separate_rate'], 100, 6), 2); - $this->financialRecordService->mpSeparateAccountByOLOrderComp($mpInfo->admin_user_id, $global_order_id, $money); } // =======服务商、市场经理奖励分账 / End=======