优化 删除算法
This commit is contained in:
parent
792c2ce6ca
commit
a6c5e7e89a
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user