改进 任务删除

This commit is contained in:
iVampireSP.com 2022-10-28 15:32:44 +08:00
parent e465e7469b
commit 37119da4fb
No known key found for this signature in database
GPG Key ID: 2F7B001CA27A8132

View File

@ -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();
}
}