From c390790f06fa85dc51a255d8f1f3c5f85a3defc6 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 27 Nov 2019 20:15:53 +0800 Subject: [PATCH] update --- app/Http/Controllers/OrderController.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/app/Http/Controllers/OrderController.php b/app/Http/Controllers/OrderController.php index 13239677..470b7274 100755 --- a/app/Http/Controllers/OrderController.php +++ b/app/Http/Controllers/OrderController.php @@ -87,12 +87,10 @@ class OrderController extends Controller if ($user->invite_user_id) { $order->invite_user_id = $user->invite_user_id; $inviter = User::find($user->invite_user_id); - if ($inviter) { - if ($inviter->commission_rate) { - $order->commission_balance = $order->total_amount * ($inviter->commission_rate / 100); - } else { - $order->commission_balance = $order->total_amount * (config('v2board.invite_commission', 10) / 100); - } + if ($inviter && $inviter->commission_rate) { + $order->commission_balance = $order->total_amount * ($inviter->commission_rate / 100); + } else { + $order->commission_balance = $order->total_amount * (config('v2board.invite_commission', 10) / 100); } } if (!$order->save()) {