Browse Source

Update Upload.php

Anyon 2 years ago
parent
commit
7b3d4047cb
1 changed files with 19 additions and 0 deletions
  1. 19 0
      app/admin/controller/api/Upload.php

+ 19 - 0
app/admin/controller/api/Upload.php

@@ -17,6 +17,7 @@
 namespace app\admin\controller\api;
 
 use think\admin\Controller;
+use think\admin\helper\QueryHelper;
 use think\admin\model\SystemFile;
 use think\admin\service\AdminService;
 use think\admin\Storage;
@@ -139,6 +140,24 @@ class Upload extends Controller
     }
 
     /**
+     * 文件选择器
+     * @login true
+     * @return void
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
+     */
+    public function modal()
+    {
+        SystemFile::mQuery()->layTable(function () {
+            $this->title = '文件选择器';
+        }, function (QueryHelper $query) {
+            $query->where(['status' => 2])->order('id desc');
+            $query->like('name,hash')->dateBetween('create_at');
+        });
+    }
+
+    /**
      * 文件上传入口
      * @login true
      * @throws \think\db\exception\DataNotFoundException