123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121 |
- <?php
- namespace app\admin\controller\life;
- use app\admin\controller\BaseController;
- use app\admin\server\life\SchedulingServer;
- class CinemaScheduling extends BaseController
- {
- /**
- * Notes:获取排期列表
- * @return \support\Response
- * User: ZQ
- * Date: 2022/10/09
- */
- public function getSchedulingList()
- {
- [$page, $limit] = $this->getPage();
- $keywords = $this->request->get('keywords');
- $result = SchedulingServer::getSchedulingList($page, $limit, $keywords);
- return json_success($result, '成功');
- }
- /**
- * Notes:获取所有
- * @return \support\Response
- * User: ZQ
- * Date: 2022/9/19
- */
- public function getSchedulingAll()
- {
- $result = SchedulingServer::getSchedulingAll();
- return json_success($result, '成功');
- }
- /**
- * Notes:修改排期
- * @return \support\Response
- * User: ZQ
- * Date: 2022/10/09
- */
- public function updateScheduling()
- {
- $scheduling_id = $this->request->post('scheduling_id');
- $scheduling_start_time = $this->request->post('scheduling_start_time');
- $scheduling_end_time = $this->request->post('scheduling_end_time');
- $scheduling_cinema_id = $this->request->post('scheduling_cinema_id');
- $admin_id = $this->request->admin_id;
- $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');
- $result = SchedulingServer::updateScheduling($scheduling_id, $scheduling_start_time, $scheduling_end_time, $scheduling_cinema_id, $admin_id);
- return json_success($result, '修改成功');
- }
- /**
- * Notes:删除排期
- * @return \support\Response
- * User: ZQ
- * Date: 2022/9/13
- */
- public function delScheduling()
- {
- $scheduling_id = $this->request->get('scheduling_id');
- $admin_id = $this->request->admin_id;
- $this->validateCheck('life\SchedulingValidate', ['scheduling_id' => $scheduling_id], 'info');
- $result = SchedulingServer::delScheduling($scheduling_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 addScheduling()
- {
- $admin_id = $this->request->admin_id;
- $scheduling_start_time = $this->request->post('scheduling_start_time');
- $scheduling_end_time = $this->request->post('scheduling_end_time');
- $scheduling_cinema_id = $this->request->post('scheduling_cinema_id');
- $this->validateCheck('life\SchedulingValidate', ['scheduling_start_time' => $scheduling_start_time, 'scheduling_end_time' => $scheduling_end_time, 'scheduling_cinema_id' => $scheduling_cinema_id], 'create');
- $result = SchedulingServer::insertScheduling($scheduling_start_time, $scheduling_end_time, $scheduling_cinema_id, $admin_id);
- return json_success($result, '添加成功');
- }
- /**
- * Notes:查询排期详情
- * @return \support\Response
- * User: ZQ
- * Date: 2022/9/13
- */
- public function schedulingInfo()
- {
- $scheduling_id = $this->request->get('scheduling_id');
- $this->validateCheck('life\SchedulingValidate', ['scheduling_id' => $scheduling_id], 'info');
- $result = SchedulingServer::schedulingInfo($scheduling_id);
- return json_success($result, '成功');
- }
- /**
- * Notes:排期上架下架
- * @return \support\Response
- * User: ZQ
- * Date: 2022/10/09
- */
- public function updateStatus()
- {
- $scheduling_id = $this->request->get('scheduling_id');
- $scheduling_status = $this->request->get('scheduling_status');
- $this->validateCheck('life\SchedulingValidate', ['scheduling_id' => $scheduling_id], 'info');
- $result = SchedulingServer::updateStatus($scheduling_id, $scheduling_status);
- return json_success($result, '修改成功');
- }
- }
|