改进 取消判断
This commit is contained in:
parent
cc93bb814c
commit
fd4b9b8d72
@ -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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user