CinemaScheduling.php 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <?php
  2. namespace app\admin\controller\life;
  3. use app\admin\controller\BaseController;
  4. use app\admin\server\life\SchedulingServer;
  5. class CinemaScheduling extends BaseController
  6. {
  7. /**
  8. * Notes:获取排期列表
  9. * @return \support\Response
  10. * User: ZQ
  11. * Date: 2022/10/09
  12. */
  13. public function getSchedulingList()
  14. {
  15. [$page, $limit] = $this->getPage();
  16. $keywords = $this->request->get('keywords');
  17. $result = SchedulingServer::getSchedulingList($page, $limit, $keywords);
  18. return json_success($result, '成功');
  19. }
  20. /**
  21. * Notes:获取所有
  22. * @return \support\Response
  23. * User: ZQ
  24. * Date: 2022/9/19
  25. */
  26. public function getSchedulingAll()
  27. {
  28. $result = SchedulingServer::getSchedulingAll();
  29. return json_success($result, '成功');
  30. }
  31. /**
  32. * Notes:修改排期
  33. * @return \support\Response
  34. * User: ZQ
  35. * Date: 2022/10/09
  36. */
  37. public function updateScheduling()
  38. {
  39. $scheduling_id = $this->request->post('scheduling_id');
  40. $scheduling_start_time = $this->request->post('scheduling_start_time');
  41. $scheduling_end_time = $this->request->post('scheduling_end_time');
  42. $scheduling_cinema_id = $this->request->post('scheduling_cinema_id');
  43. $admin_id = $this->request->admin_id;
  44. $this->validateCheck('life\SchedulingValidate', ['scheduling_id' => $scheduling_id, 'scheduling_start_time' => $scheduling_start_time, 'scheduling_end_time' => $scheduling_end_time, 'scheduling_cinema_id' => $scheduling_cinema_id], 'update');
  45. $result = SchedulingServer::updateScheduling($scheduling_id, $scheduling_start_time, $scheduling_end_time, $scheduling_cinema_id, $admin_id);
  46. return json_success($result, '修改成功');
  47. }
  48. /**
  49. * Notes:删除排期
  50. * @return \support\Response
  51. * User: ZQ
  52. * Date: 2022/9/13
  53. */
  54. public function delScheduling()
  55. {
  56. $scheduling_id = $this->request->get('scheduling_id');
  57. $admin_id = $this->request->admin_id;
  58. $this->validateCheck('life\SchedulingValidate', ['scheduling_id' => $scheduling_id], 'info');
  59. $result = SchedulingServer::delScheduling($scheduling_id,$admin_id);
  60. if ($result){
  61. return json_success($result, '删除成功');
  62. }else{
  63. throw new \Exception('删除失败!');
  64. }
  65. }
  66. /**
  67. * Notes:添加排期
  68. * @return \support\Response
  69. * User: ZQ
  70. * Date: 2022/9/13
  71. */
  72. public function addScheduling()
  73. {
  74. $admin_id = $this->request->admin_id;
  75. $scheduling_start_time = $this->request->post('scheduling_start_time');
  76. $scheduling_end_time = $this->request->post('scheduling_end_time');
  77. $scheduling_cinema_id = $this->request->post('scheduling_cinema_id');
  78. $this->validateCheck('life\SchedulingValidate', ['scheduling_start_time' => $scheduling_start_time, 'scheduling_end_time' => $scheduling_end_time, 'scheduling_cinema_id' => $scheduling_cinema_id], 'create');
  79. $result = SchedulingServer::insertScheduling($scheduling_start_time, $scheduling_end_time, $scheduling_cinema_id, $admin_id);
  80. return json_success($result, '添加成功');
  81. }
  82. /**
  83. * Notes:查询排期详情
  84. * @return \support\Response
  85. * User: ZQ
  86. * Date: 2022/9/13
  87. */
  88. public function schedulingInfo()
  89. {
  90. $scheduling_id = $this->request->get('scheduling_id');
  91. $this->validateCheck('life\SchedulingValidate', ['scheduling_id' => $scheduling_id], 'info');
  92. $result = SchedulingServer::schedulingInfo($scheduling_id);
  93. return json_success($result, '成功');
  94. }
  95. /**
  96. * Notes:排期上架下架
  97. * @return \support\Response
  98. * User: ZQ
  99. * Date: 2022/10/09
  100. */
  101. public function updateStatus()
  102. {
  103. $scheduling_id = $this->request->get('scheduling_id');
  104. $scheduling_status = $this->request->get('scheduling_status');
  105. $this->validateCheck('life\SchedulingValidate', ['scheduling_id' => $scheduling_id], 'info');
  106. $result = SchedulingServer::updateStatus($scheduling_id, $scheduling_status);
  107. return json_success($result, '修改成功');
  108. }
  109. }