request->only(['page' => 1, 'size' => 10, 'status' => '', 'title' => '',], 'post'); $val = Validate::rule(Config::get('validate_rules.common')); if (!$val->check($param)) throw new ValidateException($val->getError()); return CardLogic::List($param); } //添加卡类型 public function Add() { $param = $this->request->only(['title'], 'post'); $val = Validate::rule(Config::get('validate_rules.cardAdd')); if (!$val->check($param)) throw new ValidateException($val->getError()); return CardLogic::Add($param); } //获取卡类型详情 public function Read() { $id = $this->request->post('id/d',0); return CardLogic::Read($id); } //编辑卡类型 public function Edit() { $param = $this->request->only(['id','title'], 'post'); $val = Validate::rule(Config::get('validate_rules.cardEdit')); if (!$val->check($param)) throw new ValidateException($val->getError()); return CardLogic::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 CardLogic::Change($param); } //删除卡类型 public function Delete() { $id = $this->request->post('id/d',0); return CardLogic::Delete($id); } }