SystemTicket.php 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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\system;
  12. use app\adminapi\controller\AuthController;
  13. use app\services\system\SystemTicketServices;
  14. use think\facade\App;
  15. class SystemTicket extends AuthController
  16. {
  17. public function __construct(App $app, SystemTicketServices $services)
  18. {
  19. parent::__construct($app);
  20. $this->services = $services;
  21. }
  22. public function ticketList()
  23. {
  24. $where = $this->request->getMore([
  25. ['type', 0],
  26. ['keyword', ''],
  27. ]);
  28. return app('json')->success($this->services->ticketList($where));
  29. }
  30. public function ticketForm($id)
  31. {
  32. return app('json')->success($this->services->ticketForm($id));
  33. }
  34. public function ticketSave($id)
  35. {
  36. $data = $this->request->postMore([
  37. ['print_name', ''],
  38. ['type', 0],
  39. ['yly_user_id', ''],
  40. ['yly_app_id', ''],
  41. ['yly_app_secret', ''],
  42. ['yly_sn', ''],
  43. ['fey_user', ''],
  44. ['fey_ukey', ''],
  45. ['fey_sn', ''],
  46. ['times', 1],
  47. ['print_type', 1],
  48. ['status', 1],
  49. ]);
  50. $this->services->ticketSave($id, $data);
  51. return app('json')->success('保存成功');
  52. }
  53. public function ticketSetStatus($id, $status)
  54. {
  55. $this->services->ticketSetStatus($id, $status);
  56. return app('json')->success('修改成功');
  57. }
  58. public function ticketDel($id)
  59. {
  60. $this->services->ticketDel($id);
  61. return app('json')->success('删除成功');
  62. }
  63. public function ticketContent($id)
  64. {
  65. return app('json')->success($this->services->ticketContent($id));
  66. }
  67. public function ticketContentSave($id)
  68. {
  69. $data = $this->request->postMore([
  70. ['header', 0],
  71. ['delivery', 0],
  72. ['buyer_remarks', 0],
  73. ['goods', []],
  74. ['freight', 0],
  75. ['preferential', 0],
  76. ['pay', []],
  77. ['custom', 0],
  78. ['order', []],
  79. ['code', 0],
  80. ['code_url', ''],
  81. ['show_notice', 0],
  82. ['notice_content', '']
  83. ]);
  84. $this->services->ticketContentSave($id, $data);
  85. return app('json')->success('保存成功');
  86. }
  87. }