RoutineScheme.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. namespace app\adminapi\controller\v1\application\routine;
  3. use app\adminapi\controller\AuthController;
  4. use app\services\wechat\RoutineSchemeServices;
  5. use think\facade\App;
  6. class RoutineScheme extends AuthController
  7. {
  8. public function __construct(App $app, RoutineSchemeServices $services)
  9. {
  10. parent::__construct($app);
  11. $this->services = $services;
  12. }
  13. public function schemeList()
  14. {
  15. $where = $this->request->postMore([
  16. ['title', ''],
  17. ]);
  18. return app('json')->success($this->services->schemeList($where));
  19. }
  20. public function schemeForm($id)
  21. {
  22. return app('json')->success($this->services->schemeForm($id));
  23. }
  24. public function schemeSave($id)
  25. {
  26. $data = $this->request->postMore([
  27. ['title', ''],
  28. ['path', ''],
  29. ['expire_type', -1],
  30. ['expire_num', 0],
  31. ]);
  32. $this->services->schemeSave($id, $data);
  33. return app('json')->success(100000);
  34. }
  35. public function schemeDel($id)
  36. {
  37. $res = $this->services->delete($id);
  38. if (!$res) return app('json')->fail(100008);
  39. return app('json')->success(100002);
  40. }
  41. }