From 022fe9013458c7bc61bb27ac39055280ef98c018 Mon Sep 17 00:00:00 2001 From: Anyon Date: Tue, 12 Jul 2022 11:22:56 +0800 Subject: [PATCH] Update File.php --- app/admin/controller/File.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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('清理重复文件记录');