123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124 |
- <?php
- namespace app\admin\controller\life;
- use app\admin\controller\BaseController;
- use app\admin\server\life\PerformersServer;
- class CinemaPerformers extends BaseController
- {
- /**
- * Notes:获取演职列表
- * @return \support\Response
- * User: ZQ
- * Date: 2022/10/09
- */
- public function getPerformersList()
- {
- [$page, $limit] = $this->getPage();
- $keywords = $this->request->get('keywords');
- $result = PerformersServer::getPerformersList($page, $limit, $keywords);
- return json_success($result, '成功');
- }
- /**
- * Notes:获取所有
- * @return \support\Response
- * User: ZQ
- * Date: 2022/9/19
- */
- public function getPerformersAll()
- {
- $type = $this->request->get('type');
- $result = PerformersServer::getPerformersAll($type);
- return json_success($result, '成功');
- }
- /**
- * Notes:修改演职
- * @return \support\Response
- * User: ZQ
- * Date: 2022/10/09
- */
- public function updatePerformers()
- {
- $performers_id = $this->request->post('performers_id');
- $performers_name = $this->request->post('performers_name');
- $performers_img = $this->request->post('performers_img');
- $performers_type = $this->request->post('performers_type');
- $performers_introduction = $this->request->post('performers_introduction');
- $admin_id = $this->request->admin_id;
- $this->validateCheck('life\PerformersValidate', ['performers_id' => $performers_id, 'performers_name' => $performers_name, 'performers_img' => $performers_img, 'performers_type' => $performers_type], 'update');
- $result = PerformersServer::updatePerformers($performers_id, $performers_name, $performers_img, $performers_type, $performers_introduction, $admin_id);
- return json_success($result, '修改成功');
- }
- /**
- * Notes:删除演职
- * @return \support\Response
- * User: ZQ
- * Date: 2022/9/13
- */
- public function delPerformers()
- {
- $performers_id = $this->request->get('performers_id');
- $admin_id = $this->request->admin_id;
- $this->validateCheck('life\PerformersValidate', ['performers_id' => $performers_id], 'info');
- $result = PerformersServer::delPerformers($performers_id,$admin_id);
- if ($result){
- return json_success($result, '删除成功');
- }else{
- throw new \Exception('删除失败!');
- }
- }
- /**
- * Notes:添加演职
- * @return \support\Response
- * User: ZQ
- * Date: 2022/9/13
- */
- public function addPerformers()
- {
- $performers_name = $this->request->post('performers_name');
- $admin_id = $this->request->admin_id;
- $performers_img = $this->request->post('performers_img');
- $performers_type = $this->request->post('performers_type');
- $performers_introduction = $this->request->post('performers_introduction');
- $this->validateCheck('life\PerformersValidate', ['performers_name' => $performers_name,'performers_img'=>$performers_img,'performers_type'=>$performers_type], 'create');
- $result = PerformersServer::insertPerformers($performers_name, $performers_img, $performers_type, $performers_introduction, $admin_id);
- return json_success($result, '添加成功');
- }
- /**
- * Notes:查询演职详情
- * @return \support\Response
- * User: ZQ
- * Date: 2022/9/13
- */
- public function performersInfo()
- {
- $performers_id = $this->request->get('performers_id');
- $this->validateCheck('life\PerformersValidate', ['performers_id' => $performers_id], 'info');
- $result = PerformersServer::performersInfo($performers_id);
- return json_success($result, '成功');
- }
- /**
- * Notes:演职上架下架
- * @return \support\Response
- * User: ZQ
- * Date: 2022/10/09
- */
- public function updateStatus()
- {
- $performers_id = $this->request->get('performers_id');
- $performers_status = $this->request->get('performers_status');
- $this->validateCheck('life\PerformersValidate', ['performers_id' => $performers_id], 'info');
- $result = PerformersServer::updateStatus($performers_id, $performers_status);
- return json_success($result, '修改成功');
- }
- }
|