diff --git a/app/admin/controller/File.php b/app/admin/controller/File.php index c9a675e20..39b80a84e 100644 --- a/app/admin/controller/File.php +++ b/app/admin/controller/File.php @@ -89,7 +89,7 @@ class File extends Controller public function distinct() { $map = ['uuid' => AdminService::getUserId()]; - $db1 = SystemFile::mk()->fieldRaw('max(id) id')->where($map)->group('hash'); + $db1 = SystemFile::mk()->fieldRaw('max(id) id')->where($map)->group('type,hash'); $db2 = $this->app->db->table($db1->buildSql())->alias('dt')->field('id'); SystemFile::mk()->whereRaw("id not in {$db2->buildSql()}")->delete(); $this->success('清理重复文件记录');