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); } }