【类 型】:feat

【原  因】:禁飞区 设置接口  未完待续
【过  程】:
【影  响】:

# 类型 包含:
# feat:新功能(feature)
# fix:修补bug
# docs:文档(documentation)
# style: 格式(不影响代码运行的变动)
# refactor:重构(即不是新增功能,也不是修改bug的代码变动)
# test:增加测试
# chore:构建过程或辅助工具的变动
This commit is contained in:
air 2025-06-12 12:02:51 +08:00
parent 74e4c047be
commit 5e7a9ed0cb

View File

@ -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:用处理事务 保证两表同步
*/