diff --git a/plugin/think-plugs-admin/src/controller/File.php b/plugin/think-plugs-admin/src/controller/File.php index 30331ef0c..7cd0395d5 100644 --- a/plugin/think-plugs-admin/src/controller/File.php +++ b/plugin/think-plugs-admin/src/controller/File.php @@ -108,10 +108,10 @@ class File extends Controller */ public function distinct() { - $map = ['uuid' => AdminService::getUserId()]; + $map = ['issafe' => 0, 'uuid' => AdminService::getUserId()]; $db1 = SystemFile::mk()->fieldRaw('max(id) id')->where($map)->group('type,xkey'); $db2 = $this->app->db->table($db1->buildSql())->alias('dt')->field('id'); - SystemFile::mk()->whereRaw("id not in {$db2->buildSql()}")->delete(); + SystemFile::mk()->where($map)->whereRaw("id not in {$db2->buildSql()}")->delete(); SystemFile::mk()->where($map)->where(['status' => 1])->delete(); $this->success('清理重复文件成功!'); }