This commit is contained in:
root 2019-12-01 21:13:27 +08:00
parent fdf63813df
commit 54e08ef0ba
2 changed files with 8 additions and 7 deletions

View File

@ -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

View File

@ -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();
}
}
}