123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140 |
- <?php
- namespace app\admin\controller\life;
- use app\admin\controller\BaseController;
- use app\admin\server\life\PlayServer;
- class Play extends BaseController
- {
- /**
- * Notes:获取农庄美食/采摘游玩列表
- * @return \support\Response
- * User: ZQ
- * Date: 2022/10/18
- */
- public function getPlayList()
- {
- [$page, $limit] = $this->getPage();
- $keywords = $this->request->get('keywords');
- $result = PlayServer::getPlayList($page, $limit, $keywords);
- return json_success($result, '成功');
- }
- /**
- * Notes:获取所有农庄美食/采摘游玩单品
- * @return \support\Response
- * User: ZQ
- * Date: 2022/10/18
- */
- public function getPlayAll()
- {
- // $play_category_id = $this->request->get('play_category_id');
- $result = PlayServer::getPlayAll();
- return json_success($result, '成功');
- }
- /**
- * Notes:修改农庄美食/采摘游玩
- * @return \support\Response
- * User: ZQ
- * Date: 2022/10/18
- */
- public function updatePlay()
- {
- $play_id = $this->request->post('play_id');
- $play_name = $this->request->post('play_name');
- $play_img = $this->request->post('play_img');
- $play_price = $this->request->post('play_price');
- $play_shop_id = $this->request->post('play_shop_id');
- $play_valid = $this->request->post('play_valid','');
- $play_time = $this->request->post('play_time','');
- $play_type = $this->request->post('play_type');
- $play_package = $this->request->post('play_package','');
- $play_label = $this->request->post('play_label');
- $play_content = $this->request->post('play_content');
- $play_category = $this->request->post('play_category');
- $play_status = $this->request->post('play_status');
- $admin_id = $this->request->admin_id;
- $this->validateCheck('life\PlayValidate', ['play_id'=>$play_id,'play_name'=>$play_name,'play_img'=>$play_img,'play_price'=>$play_price,'play_shop_id'=>$play_shop_id,'play_valid'=>$play_valid,'play_time'=>$play_time,'play_type'=>$play_type,'play_label'=>$play_label,'play_status'=>$play_status,'play_content'=>$play_content,'play_category'=>$play_category], 'update');
- $result = PlayServer::updatePlay($play_id, $play_name, $play_img, $play_price, $play_shop_id, $play_valid, $play_time, $play_type, $play_package, $play_label, $play_status, $play_content, $play_category, $admin_id);
- return json_success($result, '修改成功');
- }
- /**
- * Notes:删除农庄美食/采摘游玩
- * @return \support\Response
- * User: ZQ
- * Date: 2022/10/18
- */
- public function delPlay()
- {
- $play_id = $this->request->get('play_id');
- $admin_id = $this->request->admin_id;
- $this->validateCheck('life\PlayValidate', ['play_id' => $play_id], 'info');
- $result = PlayServer::delPlay($play_id,$admin_id);
- if ($result){
- return json_success($result, '删除成功');
- }else{
- throw new \Exception('删除失败!');
- }
- }
- /**
- * Notes:添加农庄美食/采摘游玩
- * @return \support\Response
- * User: ZQ
- * Date: 2022/10/18
- */
- public function addPlay()
- {
- $play_name = $this->request->post('play_name');
- $play_img = $this->request->post('play_img');
- $play_price = $this->request->post('play_price');
- $play_shop_id = $this->request->post('play_shop_id');
- $play_valid = $this->request->post('play_valid','');
- $play_time = $this->request->post('play_time','');
- $play_type = $this->request->post('play_type');
- $play_package = $this->request->post('play_package','');
- $play_label = $this->request->post('play_label');
- $play_content = $this->request->post('play_content');
- $play_status = $this->request->post('play_status');
- $play_category = $this->request->post('play_category');
- $admin_id = $this->request->admin_id;
- $this->validateCheck('life\PlayValidate', ['play_name'=>$play_name,'play_img'=>$play_img,'play_price'=>$play_price,'play_shop_id'=>$play_shop_id,'play_valid'=>$play_valid,'play_time'=>$play_time,'play_type'=>$play_type,'play_label'=>$play_label,'play_status'=>$play_status,'play_content'=>$play_content,'play_category'=>$play_category], 'create');
- $result = PlayServer::insertPlay($play_name, $play_img, $play_price, $play_shop_id, $play_valid, $play_time, $play_type, $play_package, $play_label, $play_status, $play_content, $play_category, $admin_id);
- return json_success($result, '添加成功');
- }
- /**
- * Notes:查询农庄美食/采摘游玩详情
- * @return \support\Response
- * User: ZQ
- * Date: 2022/10/18
- */
- public function playInfo()
- {
- $play_id = $this->request->get('play_id');
- $this->validateCheck('life\PlayValidate', ['play_id' => $play_id], 'info');
- $result = PlayServer::playInfo($play_id);
- return json_success($result, '成功');
- }
- /**
- * Notes:农庄美食/采摘游玩上架下架
- * @return \support\Response
- * User: ZQ
- * Date: 2022/10/18
- */
- public function updateStatus()
- {
- $play_id = $this->request->get('play_id');
- $play_status = $this->request->get('play_status');
- $this->validateCheck('life\PlayValidate', ['play_id' => $play_id], 'info');
- $result = PlayServer::updateStatus($play_id, $play_status);
- return json_success($result, '修改成功');
- }
- }
|