update: fix tryout speedlimit

This commit is contained in:
v2board 2022-12-22 21:57:20 +08:00
parent e5fcec6a2a
commit 731a2b247a
2 changed files with 3 additions and 7 deletions

View File

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

View File

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