文件用户隔离

This commit is contained in:
Anyon 2022-06-27 15:45:59 +08:00
parent b1054f4390
commit 46644f6482
2 changed files with 9 additions and 8 deletions

View File

@ -19,6 +19,7 @@ namespace app\admin\controller;
use think\admin\Controller;
use think\admin\helper\QueryHelper;
use think\admin\model\SystemFile;
use think\admin\service\AdminService;
/**
* 系统文件管理
@ -53,8 +54,8 @@ class File extends Controller
$this->title = '系统文件管理';
$this->xexts = SystemFile::mk()->distinct()->column('xext');
}, function (QueryHelper $query) {
$query->like('name,hash,xext')->dateBetween('create_at');
$query->where(['issafe' => 0, 'status' => 2])->equal('type');
$query->like('name,hash,xext')->equal('type')->dateBetween('create_at');
$query->where(['issafe' => 0, 'status' => 2, 'uuid' => AdminService::getUserId()]);
});
}

View File

@ -152,8 +152,8 @@ class Upload extends Controller
SystemFile::mQuery()->layTable(function () {
$this->title = '文件选择器';
}, function (QueryHelper $query) {
$query->like('name,hash')->dateBetween('create_at');
$query->where(['status' => 2, 'issafe' => 0])->order('id desc');
$query->like('name,hash')->dateBetween('create_at')->order('id desc');
$query->where(['status' => 2, 'issafe' => 0, 'uuid' => AdminService::getUserId()]);
});
}
@ -170,8 +170,8 @@ class Upload extends Controller
SystemFile::mQuery()->layTable(function () {
$this->title = '文件选择器';
}, function (QueryHelper $query) {
$query->where(['status' => 2])->order('id desc');
$query->like('name,hash')->dateBetween('create_at');
$query->like('name,hash')->dateBetween('create_at')->order('id desc');
$query->where(['status' => 2, 'issafe' => 0, 'uuid' => AdminService::getUserId()]);
});
}
@ -188,8 +188,8 @@ class Upload extends Controller
SystemFile::mQuery()->layTable(function () {
$this->title = '文件选择器';
}, function (QueryHelper $query) {
$query->where(['status' => 2])->order('id desc');
$query->like('name,hash')->dateBetween('create_at');
$query->like('name,hash')->dateBetween('create_at')->order('id desc');
$query->where(['status' => 2, 'issafe' => 0, 'uuid' => AdminService::getUserId()]);
});
}