Notice.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. namespace app\admin\controller;
  3. use app\admin\common\AdminController;
  4. use app\common\api\NoticeApi;
  5. /**
  6. * Description of Notice
  7. *
  8. * @author sgq
  9. */
  10. class Notice extends AdminController {
  11. public function index() {
  12. return view();
  13. }
  14. public function list() {
  15. $res = NoticeApi::getList($this->request->param());
  16. return json($res);
  17. }
  18. /**
  19. * @auth {{/notice/add}}
  20. * @return type
  21. */
  22. public function add() {
  23. if ($this->request->isPost()) {
  24. try {
  25. } catch (\think\exception $e) {
  26. return json(["msg" => $e->getMessage()]);
  27. }
  28. NoticeApi::update($this->request->param());
  29. exit();
  30. }
  31. return view();
  32. }
  33. /**
  34. * @auth {{/notice/update}}
  35. * @return type
  36. */
  37. public function edit() {
  38. if ($this->request->isPost()) {
  39. exit();
  40. }
  41. return view();
  42. }
  43. /**
  44. * @auth {{/notice/delete}}
  45. * @return type
  46. */
  47. public function delete() {
  48. if ($this->request->isPost()) {
  49. $params = $this->request->param();
  50. $id = $params["id"];
  51. }
  52. }
  53. }