|
|
|
@ -211,9 +211,9 @@ class PaymentService extends AbstractService
|
|
|
|
|
$order->remark = $params['remark'] ?? '';
|
|
|
|
|
$order->save();
|
|
|
|
|
|
|
|
|
|
$platformAccount = User::getPlatformAccount();
|
|
|
|
|
$platformAccount = User::getPlatformAccount($params['isAccountPay']);
|
|
|
|
|
$feeRate = 0.007;
|
|
|
|
|
if ($user->source == 1) {
|
|
|
|
|
if ($params['isAccountPay']) {
|
|
|
|
|
$feeRate = 0.0023;
|
|
|
|
|
}
|
|
|
|
|
$fee = $platformAccount ? floor($order->amount * $feeRate) : 0;
|
|
|
|
@ -263,6 +263,25 @@ class PaymentService extends AbstractService
|
|
|
|
|
'seller_flag' => 0,
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
if ($params['isAccountPay']) {
|
|
|
|
|
$feeSubOrderNo = StringHelper::generateOrderNo(StringHelper::ORDER_NO_TYPE_PAY_SPLIT);
|
|
|
|
|
$mainAccount = User::where('user_id', 'RLX1990')->first();
|
|
|
|
|
$orderSplitInfos[] = [
|
|
|
|
|
'app_id' => $app->app_id,
|
|
|
|
|
'user_id' => $user->user_id,
|
|
|
|
|
'member_id' => $user->member_id,
|
|
|
|
|
'split_member_id' => $mainAccount->member_id,
|
|
|
|
|
'split_user_id' => $mainAccount->user_id,
|
|
|
|
|
'split_user_type' => $mainAccount->user_type,
|
|
|
|
|
'order_no' => $order->order_no,
|
|
|
|
|
'out_order_no' => $order->out_order_no,
|
|
|
|
|
'sub_order_no' => $feeSubOrderNo,
|
|
|
|
|
'sub_out_order_no' => $feeSubOrderNo,
|
|
|
|
|
'split_amount' => $order->amount - $fee,
|
|
|
|
|
'contract_no' => $platformAccount->contract_no,
|
|
|
|
|
'seller_flag' => 0,
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
OrderSplitInfo::insert($orderSplitInfos);
|
|
|
|
|
return [$order, $orderSplitInfos];
|
|
|
|
|
}
|
|
|
|
|