request->only([ 'page' => 1, 'size' => 10, 'status' => '', 'video_sn' => '', 'video_name' => '', 'video_url' => '', ], 'post'); return VideoLogic::list($param); } //添加视频 public function add() { $param = $this->request->only([ 'video_name', 'video_url', 'video_img', 'weight' => '', 'remark' => '', ], 'post'); $val = Validate::rule(Config::get('validate_rules.videoAdd')); if (!$val->check($param)) throw new ValidateException($val->getError()); return VideoLogic::add($param); } //读取视频详情 public function read() { $id = $this->request->post('id/d', 0); return VideoLogic::read($id); } //编辑视频 public function edit() { $param = $this->request->only([ 'id', 'video_name', 'video_url', 'video_img', 'weight' => '', 'remark' => '', ], 'post'); $val = Validate::rule(Config::get('validate_rules.videoEdit')); if (!$val->check($param)) throw new ValidateException($val->getError()); return VideoLogic::edit($param); } //视频启禁用 public function change() { $param = $this->request->only(['id', 'status',], 'post'); $val = Validate::rule(Config::get('validate_rules.status')); if (!$val->check($param)) throw new ValidateException($val->getError()); return VideoLogic::change($param); } //删除视频 public function delete() { $id = $this->request->post('id/d', 0); return VideoLogic::delete($id); } }