CinemaPerformers.php 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <?php
  2. namespace app\admin\controller\life;
  3. use app\admin\controller\BaseController;
  4. use app\admin\server\life\PerformersServer;
  5. class CinemaPerformers extends BaseController
  6. {
  7. /**
  8. * Notes:获取演职列表
  9. * @return \support\Response
  10. * User: ZQ
  11. * Date: 2022/10/09
  12. */
  13. public function getPerformersList()
  14. {
  15. [$page, $limit] = $this->getPage();
  16. $keywords = $this->request->get('keywords');
  17. $result = PerformersServer::getPerformersList($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 getPerformersAll()
  27. {
  28. $type = $this->request->get('type');
  29. $result = PerformersServer::getPerformersAll($type);
  30. return json_success($result, '成功');
  31. }
  32. /**
  33. * Notes:修改演职
  34. * @return \support\Response
  35. * User: ZQ
  36. * Date: 2022/10/09
  37. */
  38. public function updatePerformers()
  39. {
  40. $performers_id = $this->request->post('performers_id');
  41. $performers_name = $this->request->post('performers_name');
  42. $performers_img = $this->request->post('performers_img');
  43. $performers_type = $this->request->post('performers_type');
  44. $performers_introduction = $this->request->post('performers_introduction');
  45. $admin_id = $this->request->admin_id;
  46. $this->validateCheck('life\PerformersValidate', ['performers_id' => $performers_id, 'performers_name' => $performers_name, 'performers_img' => $performers_img, 'performers_type' => $performers_type], 'update');
  47. $result = PerformersServer::updatePerformers($performers_id, $performers_name, $performers_img, $performers_type, $performers_introduction, $admin_id);
  48. return json_success($result, '修改成功');
  49. }
  50. /**
  51. * Notes:删除演职
  52. * @return \support\Response
  53. * User: ZQ
  54. * Date: 2022/9/13
  55. */
  56. public function delPerformers()
  57. {
  58. $performers_id = $this->request->get('performers_id');
  59. $admin_id = $this->request->admin_id;
  60. $this->validateCheck('life\PerformersValidate', ['performers_id' => $performers_id], 'info');
  61. $result = PerformersServer::delPerformers($performers_id,$admin_id);
  62. if ($result){
  63. return json_success($result, '删除成功');
  64. }else{
  65. throw new \Exception('删除失败!');
  66. }
  67. }
  68. /**
  69. * Notes:添加演职
  70. * @return \support\Response
  71. * User: ZQ
  72. * Date: 2022/9/13
  73. */
  74. public function addPerformers()
  75. {
  76. $performers_name = $this->request->post('performers_name');
  77. $admin_id = $this->request->admin_id;
  78. $performers_img = $this->request->post('performers_img');
  79. $performers_type = $this->request->post('performers_type');
  80. $performers_introduction = $this->request->post('performers_introduction');
  81. $this->validateCheck('life\PerformersValidate', ['performers_name' => $performers_name,'performers_img'=>$performers_img,'performers_type'=>$performers_type], 'create');
  82. $result = PerformersServer::insertPerformers($performers_name, $performers_img, $performers_type, $performers_introduction, $admin_id);
  83. return json_success($result, '添加成功');
  84. }
  85. /**
  86. * Notes:查询演职详情
  87. * @return \support\Response
  88. * User: ZQ
  89. * Date: 2022/9/13
  90. */
  91. public function performersInfo()
  92. {
  93. $performers_id = $this->request->get('performers_id');
  94. $this->validateCheck('life\PerformersValidate', ['performers_id' => $performers_id], 'info');
  95. $result = PerformersServer::performersInfo($performers_id);
  96. return json_success($result, '成功');
  97. }
  98. /**
  99. * Notes:演职上架下架
  100. * @return \support\Response
  101. * User: ZQ
  102. * Date: 2022/10/09
  103. */
  104. public function updateStatus()
  105. {
  106. $performers_id = $this->request->get('performers_id');
  107. $performers_status = $this->request->get('performers_status');
  108. $this->validateCheck('life\PerformersValidate', ['performers_id' => $performers_id], 'info');
  109. $result = PerformersServer::updateStatus($performers_id, $performers_status);
  110. return json_success($result, '修改成功');
  111. }
  112. }