request->isAjax()) { $get = $this->request->get(); $lists = MallNewsLogic::lists($get); return JsonServer::success('', $lists); } return view('', [ 'shop' => LiveRoomLogic::shopLists() ]); } public function add() { if ($this->request->isAjax()) { $post = $this->request->post(); $result = MallNewsLogic::create($post); if ($result['code'] == 1) { return JsonServer::success('添加成功'); } return JsonServer::error($result['msg']); } return view('', [ 'max_upload_size' => MallNewsLogic::$MAX_UPLOAD_SIZE . 'Mb', 'max_upload_file' => MallNewsLogic::$MAX_UPLOAD_FILE, ]); } public function audit() { if ($this->request->isAjax()) { $post = $this->request->post(); $result = MallNewsLogic::edit($post); if ($result['code'] == 1) { return JsonServer::success('修改成功'); } return JsonServer::error($result['msg']); } $id = $this->request->get('id'); return view('', [ 'detail' => MallNewsLogic::detail($id), 'max_upload_size' => MallNewsLogic::$MAX_UPLOAD_SIZE . 'Mb', 'max_upload_file' => MallNewsLogic::$MAX_UPLOAD_FILE, ]); } // 上传视频到OSS public function uploadVideo() { $result = MallNewsLogic::uploadVideo(); if ($result['code'] == 1) { return JsonServer::success('', $result['data']); } return JsonServer::error('', $result['msg']); } // 删除视频 public function delVideo() { if ($this->request->isAjax()) { $file = $this->request->post('videoFile'); MallNewsLogic::delVideo($file); } } // 删除文章 public function del() { if ($this->request->isAjax()) { $post = $this->request->post(); $result = MallNewsLogic::del($post['id']); if ($result) { return JsonServer::success('删除成功'); } return JsonServer::error('删除失败'); } } }