CinemaMold.php 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. <?php
  2. namespace app\admin\controller\life;
  3. use app\admin\controller\BaseController;
  4. use app\admin\server\life\MoldServer;
  5. class CinemaMold extends BaseController
  6. {
  7. /**
  8. * Notes:获取影片类型类型列表
  9. * @return \support\Response
  10. * User: ZQ
  11. * Date: 2022/10/09
  12. */
  13. public function getMoldList()
  14. {
  15. [$page, $limit] = $this->getPage();
  16. $keywords = $this->request->get('keywords');
  17. $result = MoldServer::getMoldList($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 getMoldAll()
  27. {
  28. $result = MoldServer::getMoldAll();
  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 updateMold()
  38. {
  39. $mold_id = $this->request->post('mold_id');
  40. $mold_name = $this->request->post('mold_name');
  41. $admin_id = $this->request->admin_id;
  42. $this->validateCheck('life\MoldValidate', ['mold_id' => $mold_id, 'mold_name' => $mold_name], 'update');
  43. $result = MoldServer::updateMold ($mold_id, $mold_name, $admin_id);
  44. return json_success($result, '修改成功');
  45. }
  46. /**
  47. * Notes:删除影片类型
  48. * @return \support\Response
  49. * User: ZQ
  50. * Date: 2022/9/13
  51. */
  52. public function delMold()
  53. {
  54. $mold_id = $this->request->get('mold_id');
  55. $admin_id = $this->request->admin_id;
  56. $this->validateCheck('life\MoldValidate', ['mold_id' => $mold_id], 'info');
  57. $result = MoldServer::delMold($mold_id,$admin_id);
  58. if ($result){
  59. return json_success($result, '删除成功');
  60. }else{
  61. throw new \Exception('删除失败!');
  62. }
  63. }
  64. /**
  65. * Notes:添加影片类型
  66. * @return \support\Response
  67. * User: ZQ
  68. * Date: 2022/9/13
  69. */
  70. public function addMold()
  71. {
  72. $mold_name = $this->request->post('mold_name');
  73. $admin_id = $this->request->admin_id;
  74. $this->validateCheck('life\MoldValidate', ['mold_name' => $mold_name], 'create');
  75. $result = MoldServer::insertMold($mold_name, $admin_id);
  76. return json_success($result, '添加成功');
  77. }
  78. /**
  79. * Notes:查询影片类型详情
  80. * @return \support\Response
  81. * User: ZQ
  82. * Date: 2022/9/13
  83. */
  84. public function moldInfo()
  85. {
  86. $mold_id = $this->request->get('mold_id');
  87. $this->validateCheck('life\MoldValidate', ['mold_id' => $mold_id], 'info');
  88. $result = MoldServer::moldInfo($mold_id);
  89. return json_success($result, '成功');
  90. }
  91. /**
  92. * Notes:影片类型上架下架
  93. * @return \support\Response
  94. * User: ZQ
  95. * Date: 2022/10/09
  96. */
  97. public function updateStatus()
  98. {
  99. $mold_id = $this->request->get('mold_id');
  100. $mold_status = $this->request->get('mold_status');
  101. $this->validateCheck('life\MoldValidate', ['mold_id' => $mold_id], 'info');
  102. $result = MoldServer::updateStatus($mold_id, $mold_status);
  103. return json_success($result, '修改成功');
  104. }
  105. }