diff --git a/app/Models/Host.php b/app/Models/Host.php index fbfbe21..f6faef0 100644 --- a/app/Models/Host.php +++ b/app/Models/Host.php @@ -199,6 +199,11 @@ public function scopeThisUser($query, $module = null) public function safeDelete(): bool { + // 如果创建时间大于大于 1 小时 + if ($this->created_at->diffInHours(now()) > 1) { + $this->cost(); + } + dispatch(new \App\Jobs\Module\Host($this, 'delete')); return true; }