🐛 修复 BUG

This commit is contained in:
Wisp X
2022-01-14 16:41:03 +08:00
parent 6e2088f5b6
commit 08c8ce757e
+2 -1
View File
@@ -79,8 +79,9 @@ class Image extends Model
{
static::deleting(function (self $image) {
// TODO 检测是否启用了队列,放置队列中异步删除
// 是否存在其他相同 md5 和 sha1 的记录,没有则可以删除物理文件
// 在当前图片所属的策略中是否存在其他相同 md5 和 sha1 的记录,没有则可以删除物理文件
if (! static::query()
->where('strategy_id', $image->strategy)
->where('id', '<>', $image->id)
->where('md5', $image->md5)
->where('sha1', $image->sha1)