From 37119da4fbd995c93f7cd880fe47921f6921d4a4 Mon Sep 17 00:00:00 2001 From: "iVampireSP.com" Date: Fri, 28 Oct 2022 15:32:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9B=20=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Jobs/ClearTasks.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/app/Jobs/ClearTasks.php b/app/Jobs/ClearTasks.php index fb8f8b8..afdff18 100644 --- a/app/Jobs/ClearTasks.php +++ b/app/Jobs/ClearTasks.php @@ -31,10 +31,7 @@ public function __construct() */ public function handle() { - // - - // 删除所有状态不为 pending 的任务 - Task::where('status', '!=', 'pending')->delete(); - + // 删除所有大于 1 天的任务 + Task::where('created_at', '<', now()->subDays(1))->delete(); } }