SystemTicket.php 2.3 KB

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