|
|
|
@ -59,7 +59,7 @@ class SeparateAccountsService implements SeparateAccountsServiceInterface |
|
|
|
} |
|
|
|
|
|
|
|
// =======用户支付流水 / Start=======
|
|
|
|
$this->financialRecordService->userByOFLOrderPaid($orderMain->user_id, $orderMain->id, $orderMain->money); |
|
|
|
$this->financialRecordService->userByOFLOrderPaid($orderMain->user_id, $global_order_id, $orderMain->money); |
|
|
|
// =======用户支付流水 / End=======
|
|
|
|
} |
|
|
|
|
|
|
|
@ -113,7 +113,7 @@ class SeparateAccountsService implements SeparateAccountsServiceInterface |
|
|
|
StoreAccount::query()->insert(array_merge($storeAccountBase, $storeAccount)); |
|
|
|
|
|
|
|
// 新商户流水
|
|
|
|
$this->financialRecordService->storeByOLOrderComp($store->user_id, $orderMain->id ,$order['money']); |
|
|
|
$this->financialRecordService->storeByOLOrderComp($store->user_id, $global_order_id ,$order['money']); |
|
|
|
} |
|
|
|
// =======商户订单收入流水 / End=======
|
|
|
|
|
|
|
|
@ -141,13 +141,13 @@ class SeparateAccountsService implements SeparateAccountsServiceInterface |
|
|
|
|
|
|
|
// 平台新用户
|
|
|
|
if ($this->userService->isPlatformNewUser($orderMain->user_id, $orderMain->id)) { |
|
|
|
$this->financialRecordService->communityAwardByPlatNewUser($communityBind->source_id, $orderMain->global_order_id, $award['new_user_reward']); |
|
|
|
$this->financialRecordService->communityAwardByPlatNewUserFirstOLOrder($communityBind->source_id, $orderMain->global_order_id, $award['first_reward']); |
|
|
|
$this->financialRecordService->communityAwardByPlatNewUser($communityBind->source_id, $global_order_id, $award['new_user_reward']); |
|
|
|
$this->financialRecordService->communityAwardByPlatNewUserFirstOLOrder($communityBind->source_id, $global_order_id, $award['first_reward']); |
|
|
|
} |
|
|
|
|
|
|
|
// 账单分成
|
|
|
|
$money = bcmul($orderMain->money, bcdiv($award['flow_reward'], 100, 6), 2); |
|
|
|
$this->financialRecordService->communitySeparateAccountsByOrderComp($communityBind->source_id, $orderMain->global_order_id, $money); |
|
|
|
$this->financialRecordService->communitySeparateAccountsByOrderComp($communityBind->source_id, $global_order_id, $money); |
|
|
|
} |
|
|
|
|
|
|
|
// =======社区服务点分账 / End=======
|
|
|
|
@ -193,7 +193,7 @@ class SeparateAccountsService implements SeparateAccountsServiceInterface |
|
|
|
try { |
|
|
|
|
|
|
|
// =======用户支付流水 / Start=======
|
|
|
|
$this->financialRecordService->userByOFLOrderPaid($orderMain->user_id, $orderMain->id, $orderMain->money); |
|
|
|
$this->financialRecordService->userByOFLOrderPaid($orderMain->user_id, $global_order_id, $orderMain->money); |
|
|
|
// =======用户支付流水 / End=======
|
|
|
|
|
|
|
|
// =======线下订单支付完成商户分账 / Start=======
|
|
|
|
@ -224,7 +224,7 @@ class SeparateAccountsService implements SeparateAccountsServiceInterface |
|
|
|
$store = Store::find($order->store_id); |
|
|
|
|
|
|
|
// 新商户订单流水
|
|
|
|
$this->financialRecordService->storeByOFLOrderComp($store->user_id, $orderMain->id, $order->money); |
|
|
|
$this->financialRecordService->storeByOFLOrderComp($store->user_id, $global_order_id, $order->money); |
|
|
|
|
|
|
|
$needAward = false; |
|
|
|
$awardAmount = 0; |
|
|
|
@ -239,7 +239,7 @@ class SeparateAccountsService implements SeparateAccountsServiceInterface |
|
|
|
'category' => 3, |
|
|
|
]; |
|
|
|
// 新商户流水
|
|
|
|
$this->financialRecordService->storeAwardByPlatNewUserOFLOrder($store->user_id, $orderMain->id, $awardAmount); |
|
|
|
$this->financialRecordService->storeAwardByPlatNewUserOFLOrder($store->user_id, $global_order_id, $awardAmount); |
|
|
|
$needAward = true; |
|
|
|
|
|
|
|
} else { |
|
|
|
@ -261,7 +261,7 @@ class SeparateAccountsService implements SeparateAccountsServiceInterface |
|
|
|
'category' => 4, |
|
|
|
]; |
|
|
|
// 新商户流水
|
|
|
|
$this->financialRecordService->storeAwardByTodayFirstOFLOrder($store->user_id, $orderMain->id, $awardAmount); |
|
|
|
$this->financialRecordService->storeAwardByTodayFirstOFLOrder($store->user_id, $global_order_id, $awardAmount); |
|
|
|
$needAward = true; |
|
|
|
|
|
|
|
} |
|
|
|
|