From a6c5e7e89a3ae7660d5022cf8979404ba32d94b7 Mon Sep 17 00:00:00 2001 From: "iVampireSP.com" Date: Tue, 22 Nov 2022 19:31:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E7=AE=97=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Models/Host.php | 5 +++++ 1 file changed, 5 insertions(+) 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; }