mirror of
https://github.com/v2board/v2board.git
synced 2024-11-13 02:59:10 +08:00
opt
This commit is contained in:
parent
35917ad199
commit
00c2dee361
@ -66,13 +66,16 @@ class ResetTraffic extends Command
|
|||||||
private function resetByExpireDay($user):void
|
private function resetByExpireDay($user):void
|
||||||
{
|
{
|
||||||
$lastDay = date('d', strtotime('last day of +0 months'));
|
$lastDay = date('d', strtotime('last day of +0 months'));
|
||||||
|
$users = [];
|
||||||
foreach ($user->get() as $item) {
|
foreach ($user->get() as $item) {
|
||||||
$expireDay = date('d', $item->expired_at);
|
$expireDay = date('d', $item->expired_at);
|
||||||
if ($expireDay === date('d') || (string)$lastDay === '29' || (string)$lastDay === '30') {
|
if ($expireDay === date('d') || (string)$lastDay === '29' || (string)$lastDay === '30') {
|
||||||
$item->u = 0;
|
array_push($users, $item->id);
|
||||||
$item->d = 0;
|
|
||||||
$item->save();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$user->whereIn('id', $users)->update([
|
||||||
|
'u' => 0,
|
||||||
|
'd' => 0
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
2
public/assets/admin/umi.js
vendored
2
public/assets/admin/umi.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user