//新增 public function add(){ if($this->request->isPost()){ $flag = $this->model->add($this->request); if($flag){ $this->success('添加成功', url('getList')); }else{ $this->error('添加失败'); } }else{ return $this->fetch(); } }