withSearch(['name', 'path', 'createNickname'], [ 'name' => $this->request->param('name/s', ''), 'path' => $this->request->param('path/s', ''), 'createNickname' => $this->request->param('createNickname/s', ''), 'createTime' => [ $this->request->get('createTimeStart/s', ''), $this->request->get('createTimeEnd/s', '') ], ]); $paginate = CurdService::getPaginate($this->request, $model); return $this->writeSuccess('ok', $paginate); } public function batchRemove() { $data = $this->request->delete(); SysFileRecord::destroy($data); return $this->writeSuccess('删除成功'); } public function upload() { $file = $this->request->file('file'); if (empty($file)) { return $this->writeError('文件不存在'); } try { $result = filesystem()->upload($file, 0, $this->auth->userId); } catch (ValidateException|FileException $e) { return $this->writeError($e->getMessage()); } return $this->writeSuccess('ok', $result); } }