update.stub 459 B

12345678910111213141516171819202122
  1.  /**
  2. * 修改
  3. * @param $id
  4. * @return \think\Response
  5. * @date {%DATE%}
  6. */
  7. public function update($id)
  8. {
  9. if (!$id) {
  10. return app('json')->fail(100100);
  11. }
  12. $data = $this->request->postMore([
  13. {%FIELD_PHP%}
  14. ]);
  15. validate({%VALIDATE_NAME%})->check($data);
  16. {%OTHER_PHP%}
  17. $this->service->crudUpdate((int)$id, $data);
  18. return app('json')->success(100001);
  19. }