diff --git a/app/admin/controller/File.php b/app/admin/controller/File.php index 87202286a..ad4bc5693 100644 --- a/app/admin/controller/File.php +++ b/app/admin/controller/File.php @@ -110,7 +110,7 @@ class File extends Controller { $map = ['issafe' => 0, 'uuid' => AdminService::getUserId()]; $subQuery = SystemFile::mk()->fieldRaw('MAX(id) AS id')->where($map)->group('type, xkey')->buildSql(); - SystemFile::mk()->where($map)->whereRaw("id NOT IN ({$subQuery})")->delete(); + SystemFile::mk()->where($map)->whereRaw("id NOT IN (SELECT id FROM ({$subQuery}) AS file_table)")->delete(); $this->success('清理重复文件成功!'); } } \ No newline at end of file