Cinema.php 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. <?php
  2. namespace app\admin\controller\life;
  3. use app\admin\controller\BaseController;
  4. use app\admin\server\life\CinemaServer;
  5. class Cinema extends BaseController
  6. {
  7. /**
  8. * Notes:获取万悦影院列表
  9. * @return \support\Response
  10. * User: ZQ
  11. * Date: 2022/10/09
  12. */
  13. public function getCinemaList()
  14. {
  15. [$page, $limit] = $this->getPage();
  16. $keywords = $this->request->get('keywords');
  17. $result = CinemaServer::getCinemaList($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 getCinemaAll()
  27. {
  28. $result = CinemaServer::getCinemaAll();
  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 updateCinema()
  38. {
  39. $cinema_id = $this->request->post('cinema_id');
  40. $cinema_name = $this->request->post('cinema_name');
  41. $cinema_video = $this->request->post('cinema_video','');
  42. $cinema_mold = $this->request->post('cinema_mold');
  43. $cinema_director= $this->request->post('cinema_director');
  44. $cinema_star = $this->request->post('cinema_star');
  45. $cinema_introduction = $this->request->post('cinema_introduction');
  46. $cinema_price = $this->request->post('cinema_price');
  47. $cinema_performers = $this->request->post('cinema_performers');
  48. $cinema_seat = $this->request->post('cinema_seat');
  49. $cinema_length = $this->request->post('cinema_length');
  50. $cinema_week = $this->request->post('cinema_week','');
  51. $cinema_time = $this->request->post('cinema_time');
  52. $cinema_label = $this->request->post('cinema_label');
  53. $cinema_img = $this->request->post('cinema_img');
  54. $cinema_status = $this->request->post('cinema_status');
  55. $admin_id = $this->request->admin_id;
  56. $this->validateCheck('life\CinemaValidate', ['cinema_id' => $cinema_id], 'update');
  57. $result = CinemaServer::updateCinema($cinema_id, $cinema_name, $cinema_video, $cinema_mold, $cinema_director, $cinema_star, $cinema_price, $cinema_introduction, $cinema_performers, $cinema_seat, $cinema_length, $cinema_time, $cinema_label, $cinema_img, $cinema_status, $cinema_week, $admin_id);
  58. return json_success($result, '修改成功');
  59. }
  60. /**
  61. * Notes:删除影片
  62. * @return \support\Response
  63. * User: ZQ
  64. * Date: 2022/9/13
  65. */
  66. public function delCinema()
  67. {
  68. $cinema_id = $this->request->get('cinema_id');
  69. $admin_id = $this->request->admin_id;
  70. $this->validateCheck('life\CinemaValidate', ['cinema_id' => $cinema_id], 'info');
  71. $result = CinemaServer::delCinema($cinema_id,$admin_id);
  72. if ($result){
  73. return json_success($result, '删除成功');
  74. }else{
  75. throw new \Exception('删除失败!');
  76. }
  77. }
  78. /**
  79. * Notes:添加影片
  80. * @return \support\Response
  81. * User: ZQ
  82. * Date: 2022/9/13
  83. */
  84. public function addCinema()
  85. {
  86. $cinema_name = $this->request->post('cinema_name');
  87. $cinema_video = $this->request->post('cinema_video','');
  88. $cinema_mold = $this->request->post('cinema_mold');
  89. $cinema_director= $this->request->post('cinema_director');
  90. $cinema_star = $this->request->post('cinema_star');
  91. $cinema_introduction = $this->request->post('cinema_introduction');
  92. $cinema_price = $this->request->post('cinema_price');
  93. $cinema_performers = $this->request->post('cinema_performers');
  94. $cinema_seat = $this->request->post('cinema_seat');
  95. $cinema_length = $this->request->post('cinema_length');
  96. $cinema_week = $this->request->post('cinema_week','');
  97. $cinema_time = $this->request->post('cinema_time');
  98. $cinema_label = $this->request->post('cinema_label');
  99. $cinema_img = $this->request->post('cinema_img');
  100. $cinema_status = $this->request->post('cinema_status');
  101. $admin_id = $this->request->admin_id;
  102. $this->validateCheck('life\CinemaValidate', ['cinema_name' => $cinema_name, 'cinema_mold' => $cinema_mold, 'cinema_director' => $cinema_director, 'cinema_star' => $cinema_star, 'cinema_price' => $cinema_price, 'cinema_introduction' => $cinema_introduction, 'cinema_performers' => $cinema_performers], 'create');
  103. $result = CinemaServer::insertCinema($cinema_name, $cinema_video, $cinema_mold, $cinema_director, $cinema_star, $cinema_price, $cinema_introduction, $cinema_performers, $cinema_seat, $cinema_length, $cinema_time, $cinema_label, $cinema_img, $cinema_status, $cinema_week, $admin_id);
  104. return json_success($result, '添加成功');
  105. }
  106. /**
  107. * Notes:查询影片详情
  108. * @return \support\Response
  109. * User: ZQ
  110. * Date: 2022/9/13
  111. */
  112. public function cinemaInfo()
  113. {
  114. $cinema_id = $this->request->get('cinema_id');
  115. $this->validateCheck('life\CinemaValidate', ['cinema_id' => $cinema_id], 'info');
  116. $result = CinemaServer::cinemaInfo($cinema_id);
  117. return json_success($result, '成功');
  118. }
  119. /**
  120. * Notes:影片上架下架
  121. * @return \support\Response
  122. * User: ZQ
  123. * Date: 2022/10/09
  124. */
  125. public function updateStatus()
  126. {
  127. $cinema_id = $this->request->get('cinema_id');
  128. $cinema_status = $this->request->get('cinema_status');
  129. $this->validateCheck('life\CinemaValidate', ['cinema_id' => $cinema_id], 'info');
  130. $result = CinemaServer::updateStatus($cinema_id, $cinema_status);
  131. return json_success($result, '修改成功');
  132. }
  133. }