改进 取消判断

This commit is contained in:
iVampireSP.com 2023-03-08 01:15:52 +08:00
parent cc93bb814c
commit fd4b9b8d72
No known key found for this signature in database
GPG Key ID: 2F7B001CA27A8132

View File

@ -41,6 +41,7 @@ public function handle(): void
$host->where('day_at', $now->day) $host->where('day_at', $now->day)
->where('hour_at', $now->hour) ->where('hour_at', $now->hour)
->where('trial_ends_at', '<', $now) ->where('trial_ends_at', '<', $now)
->whereNot('billing_cycle', 'hourly')
->chunk(500, function ($hosts) { ->chunk(500, function ($hosts) {
$hosts->each(function ($host) { $hosts->each(function ($host) {
/* @var Host $host */ /* @var Host $host */
@ -53,6 +54,7 @@ public function handle(): void
// 查找到期的主机 // 查找到期的主机
$host->where('expired_at', '<', $now) $host->where('expired_at', '<', $now)
->whereNot('billing_cycle', 'hourly')
->chunk(500, function ($hosts) { ->chunk(500, function ($hosts) {
$hosts->each(function ($host) { $hosts->each(function ($host) {
/* @var Host $host */ /* @var Host $host */
@ -63,6 +65,10 @@ public function handle(): void
}); });
}); });
} else { } else {
if ($this->host->isHourly()) {
return;
}
if ($this->host->isNextMonthCancel()) { if ($this->host->isNextMonthCancel()) {
$this->host->safeDelete(); $this->host->safeDelete();
} else { } else {