mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2026-06-07 12:38:11 +08:00
fix: 修复清理重复文件功能会把非当前管理员的文件数据库记录全部删除的问题
This commit is contained in:
parent
ce1c27e25d
commit
18a8263f58
@ -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('清理重复文件成功!');
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user