mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2026-07-10 18:01:05 +08:00
Compare commits
5 Commits
6ae629bc60
...
e640847819
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e640847819 | ||
|
|
52f379eb05 | ||
|
|
d436e6a15b | ||
|
|
6a52e8aa31 | ||
|
|
c084ff1fb1 |
@ -20,6 +20,7 @@ use think\admin\Controller;
|
||||
use think\admin\helper\QueryHelper;
|
||||
use think\admin\model\SystemFile;
|
||||
use think\admin\service\AdminService;
|
||||
use think\admin\Storage;
|
||||
|
||||
/**
|
||||
* 系统文件管理
|
||||
@ -28,18 +29,6 @@ use think\admin\service\AdminService;
|
||||
*/
|
||||
class File extends Controller
|
||||
{
|
||||
/**
|
||||
* 存储方式处理
|
||||
* @var string[]
|
||||
*/
|
||||
protected $types = [
|
||||
'local' => '本地服务器存储',
|
||||
'qiniu' => '七牛云对象存储',
|
||||
'upyun' => '又拍云USS存储',
|
||||
'alioss' => '阿里云OSS存储',
|
||||
'txcos' => '腾讯云COS存储'
|
||||
];
|
||||
|
||||
/**
|
||||
* 系统文件管理
|
||||
* @auth true
|
||||
@ -50,6 +39,7 @@ class File extends Controller
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$this->types = Storage::types();
|
||||
SystemFile::mQuery()->layTable(function () {
|
||||
$this->title = '系统文件管理';
|
||||
$this->xexts = SystemFile::mk()->distinct()->column('xext');
|
||||
@ -92,6 +82,7 @@ class File extends Controller
|
||||
$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)->where(['status' => 1])->delete();
|
||||
$this->success('清理重复文件成功!');
|
||||
}
|
||||
}
|
||||
@ -104,7 +104,7 @@
|
||||
// 加载页面数据
|
||||
loadPage: function () {
|
||||
this.params = {page: this.page, limit: this.limit, output: 'layui.table', name: this.keys || ''};
|
||||
this.params.type = '{$get.type|default="png,jpg,jpeg"}';
|
||||
this.params.type = '{$get.type|default="gif,png,jpg,jpeg"}';
|
||||
$.form.load('{:url("image")}', this.params, 'get', function (ret) {
|
||||
return app.setList(ret.data, ret.count), false;
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user