mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2026-01-08 16:26:57 +08:00
update app/admin/controller/File.php.
修复在更新表的同时在子查询中引用同一个表报错 Signed-off-by: 承诺 <1322522027@qq.com>
This commit is contained in:
parent
52e7c2faac
commit
a122a25a83
@ -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('清理重复文件成功!');
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user