diff --git a/app/Http/Controllers/Passport/AuthController.php b/app/Http/Controllers/Passport/AuthController.php index c3c28ddf..3a71152e 100644 --- a/app/Http/Controllers/Passport/AuthController.php +++ b/app/Http/Controllers/Passport/AuthController.php @@ -156,6 +156,7 @@ class AuthController extends Controller $user->plan_id = $plan->id; $user->group_id = $plan->group_id; $user->expired_at = time() + (config('v2board.try_out_hour', 1) * 3600); + $user->speed_limit = $plan->speed_limit; } } diff --git a/app/Services/UserService.php b/app/Services/UserService.php index a7f9f1ae..300be780 100644 --- a/app/Services/UserService.php +++ b/app/Services/UserService.php @@ -2,17 +2,12 @@ namespace App\Services; -use App\Jobs\ServerLogJob; use App\Jobs\StatServerJob; use App\Jobs\StatUserJob; use App\Jobs\TrafficFetchJob; -use App\Models\InviteCode; use App\Models\Order; use App\Models\Plan; -use App\Models\ServerV2ray; -use App\Models\Ticket; use App\Models\User; -use Illuminate\Support\Facades\DB; class UserService { @@ -33,9 +28,9 @@ class UserService } if ((int)$day >= (int)$today) { return $day - $today; - } else { - return $lastDay - $today + $day; } + + return $lastDay - $today + $day; } private function calcResetDayByYearFirstDay(): int