add.lt 483 B

123456789101112131415
  1. //添加
  2. public function add()
  3. {
  4. $post = CommonFun::filterPostData($this->request->post());{%validate%}{%adminUserId%}{%uploadDomainFields%}{%unsetFields%}
  5. try {
  6. if ($this->model->create($post)) {
  7. return $this->success('添加成功', $post);
  8. } else {
  9. return $this->error('操作失败');
  10. }
  11. } catch (\Exception $e) {
  12. return $this->exceptionError($e);
  13. }
  14. }