mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2026-07-13 02:41:06 +08:00
Compare commits
No commits in common. "e640847819a6ba321dd96d8dcd3d940c27a774e5" and "6ae629bc600e18cf4a3c51f6b23c5277a2dabf92" have entirely different histories.
e640847819
...
6ae629bc60
@ -20,7 +20,6 @@ use think\admin\Controller;
|
||||
use think\admin\helper\QueryHelper;
|
||||
use think\admin\model\SystemFile;
|
||||
use think\admin\service\AdminService;
|
||||
use think\admin\Storage;
|
||||
|
||||
/**
|
||||
* 系统文件管理
|
||||
@ -29,6 +28,18 @@ use think\admin\Storage;
|
||||
*/
|
||||
class File extends Controller
|
||||
{
|
||||
/**
|
||||
* 存储方式处理
|
||||
* @var string[]
|
||||
*/
|
||||
protected $types = [
|
||||
'local' => '本地服务器存储',
|
||||
'qiniu' => '七牛云对象存储',
|
||||
'upyun' => '又拍云USS存储',
|
||||
'alioss' => '阿里云OSS存储',
|
||||
'txcos' => '腾讯云COS存储'
|
||||
];
|
||||
|
||||
/**
|
||||
* 系统文件管理
|
||||
* @auth true
|
||||
@ -39,7 +50,6 @@ class File extends Controller
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$this->types = Storage::types();
|
||||
SystemFile::mQuery()->layTable(function () {
|
||||
$this->title = '系统文件管理';
|
||||
$this->xexts = SystemFile::mk()->distinct()->column('xext');
|
||||
@ -82,7 +92,6 @@ 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="gif,png,jpg,jpeg"}';
|
||||
this.params.type = '{$get.type|default="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