From 54e08ef0ba675de0c86de1a1d2c82d5cc7a49c81 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 1 Dec 2019 21:13:27 +0800 Subject: [PATCH] update --- app/Console/Commands/SystemCache.php | 2 +- .../Controllers/Passport/RegisterController.php | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/app/Console/Commands/SystemCache.php b/app/Console/Commands/SystemCache.php index 6e6c9f4a..00b75a22 100644 --- a/app/Console/Commands/SystemCache.php +++ b/app/Console/Commands/SystemCache.php @@ -4,8 +4,8 @@ namespace App\Console\Commands; use Illuminate\Console\Command; use App\Models\User; -use App\Utils\Helper; use App\Models\Order; +use App\Utils\Helper; use Illuminate\Support\Facades\Redis; class SystemCache extends Command diff --git a/app/Http/Controllers/Passport/RegisterController.php b/app/Http/Controllers/Passport/RegisterController.php index bf7fb8b5..6a9390ad 100755 --- a/app/Http/Controllers/Passport/RegisterController.php +++ b/app/Http/Controllers/Passport/RegisterController.php @@ -49,14 +49,15 @@ class RegisterController extends Controller ->where('status', 0) ->first(); if (!$inviteCode) { - if ((int)config('v2board.invite_force', env('V2BOARD_INVITE_FOCE'))) { + if ((int)config('v2board.invite_force', 0)) { abort(500, '邀请码无效'); } - } - $user->invite_user_id = $inviteCode->user_id ? $inviteCode->user_id : null; - if (!(int)config('v2board.invite_never_expire', env('V2BOARD_INVITE_NEVER_EXPIRE'))) { - $inviteCode->status = 1; - $inviteCode->save(); + } else { + $user->invite_user_id = $inviteCode->user_id ? $inviteCode->user_id : null; + if (!(int)config('v2board.invite_never_expire', env('V2BOARD_INVITE_NEVER_EXPIRE'))) { + $inviteCode->status = 1; + $inviteCode->save(); + } } }