RoutineScheme.php 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2026 https://www.crmeb.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  8. // +----------------------------------------------------------------------
  9. // | Author: CRMEB Team <admin@crmeb.com>
  10. // +----------------------------------------------------------------------
  11. namespace app\adminapi\controller\v1\application\routine;
  12. use app\adminapi\controller\AuthController;
  13. use app\services\wechat\RoutineSchemeServices;
  14. use think\facade\App;
  15. class RoutineScheme extends AuthController
  16. {
  17. public function __construct(App $app, RoutineSchemeServices $services)
  18. {
  19. parent::__construct($app);
  20. $this->services = $services;
  21. }
  22. public function schemeList()
  23. {
  24. $where = $this->request->postMore([
  25. ['title', ''],
  26. ]);
  27. return app('json')->success($this->services->schemeList($where));
  28. }
  29. public function schemeForm($id)
  30. {
  31. return app('json')->success($this->services->schemeForm($id));
  32. }
  33. public function schemeSave($id)
  34. {
  35. $data = $this->request->postMore([
  36. ['title', ''],
  37. ['path', ''],
  38. ['expire_type', -1],
  39. ['expire_num', 0],
  40. ]);
  41. $this->services->schemeSave($id, $data);
  42. return app('json')->success('保存成功');
  43. }
  44. public function schemeDel($id)
  45. {
  46. $res = $this->services->delete($id);
  47. if (!$res) return app('json')->fail('删除失败');
  48. return app('json')->success('删除成功');
  49. }
  50. }