mirror of
https://github.com/lkddi/Xboard.git
synced 2026-04-15 04:10:51 +08:00
refactor: comment out update-check routes and refactor findUserByBearerToken, calcResetDayByMonthFirstDay, calcResetDayByExpireDay
This commit is contained in:
@@ -14,20 +14,20 @@ class UserService
|
||||
{
|
||||
private function calcResetDayByMonthFirstDay(): int
|
||||
{
|
||||
$today = date('d');
|
||||
$lastDay = date('d', strtotime('last day of +0 months'));
|
||||
$today = (int) date('d');
|
||||
$lastDay = (int) date('d', strtotime('last day of +0 months'));
|
||||
return $lastDay - $today;
|
||||
}
|
||||
|
||||
private function calcResetDayByExpireDay(int $expiredAt)
|
||||
{
|
||||
$day = date('d', $expiredAt);
|
||||
$today = date('d');
|
||||
$lastDay = date('d', strtotime('last day of +0 months'));
|
||||
if ((int) $day >= (int) $today && (int) $day >= (int) $lastDay) {
|
||||
$day = (int) date('d', $expiredAt);
|
||||
$today = (int) date('d');
|
||||
$lastDay = (int) date('d', strtotime('last day of +0 months'));
|
||||
if ($day >= $today && $day >= $lastDay) {
|
||||
return $lastDay - $today;
|
||||
}
|
||||
if ((int) $day >= (int) $today) {
|
||||
if ($day >= $today) {
|
||||
return $day - $today;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user