master
ljl 1 year ago
parent 0e0c9a7963
commit bafeac8edb

@ -134,6 +134,9 @@ class PaymentService extends AbstractService
}
public function createOrder(App $app, array $params, User $user, string $payMethod) {
if ($params['amount'] < 10) {
throw new BusinessException('金额不能小于10');
}
$expiresIn = $params['expiresIn'] ?? 10 * 60;
$order = new Order();
$order->app_id = $app->app_id;
@ -159,6 +162,9 @@ class PaymentService extends AbstractService
$platformAccount = User::getPlatformAccount();
$fee = $platformAccount ? floor($order->amount * 0.007) : 0;
if ($fee <= 0) {
$fee = 1;
}
$orderSplitInfos = [];
$splitUserIds = array_column($params['splitInfoList'], 'splitUserId');
$users = User::where('app_id', $app->app_id)->whereIn('user_id', $splitUserIds)->get()->keyBy('user_id');

Loading…
Cancel
Save