diff --git a/FlyCube/MpApi/Controller/PlaneController.class.php b/FlyCube/MpApi/Controller/PlaneController.class.php index eabd0e5..7fd695e 100644 --- a/FlyCube/MpApi/Controller/PlaneController.class.php +++ b/FlyCube/MpApi/Controller/PlaneController.class.php @@ -518,6 +518,30 @@ class PlaneController extends PublicController echo json_encode(array('status' => 0, 'msg' => '删除失败')); } } + /** + * @description: 设置禁飞区 + */ + public function setNofly() + { + //总管理员 可接收任何shop_id 非总管理员 只可以调用自身shop_id 否则会中断 + $this->isPower(); + + if ($_REQUEST['shop_id']) { + $noflyDb = D('nofly'); + $where['shop_id'] = $_REQUEST['shop_id']; + $data['nofly_data'] = $_REQUEST['nofly_data']; + $data['restrictfly_data'] = $_REQUEST['restrictfly_data']; + + //录入数据库 + if ($noflyDb->where($where)->save($data)) { + echo json_encode(array('status' => 1, 'msg' => '创建成功')); + } else { + echo json_encode(array('status' => 0, 'msg' => '创建失败')); + } + } else { + echo json_encode(array('status' => 0, 'msg' => '参数有误')); + } + } /** * @description: 飞机在站点上注册航线或注销航线 并处理对应的订单 ps:用处理事务 保证两表同步 */