【类 型】:fix
【主 题】:注销 注册航线接口 【描 述】: [原因]:由于注销 注册公用接口 注销时也检测飞机id的话是肯定存在的 所以不用检测 [过程]:判断 注销调用接口是 飞机传id为空 检测空就跳过不检测 [影响]: 【结 束】 # 类型 包含: # feat:新功能(feature) # fix:修补bug # docs:文档(documentation) # style: 格式(不影响代码运行的变动) # refactor:重构(即不是新增功能,也不是修改bug的代码变动) # test:增加测试 # chore:构建过程或辅助工具的变动
This commit is contained in:
parent
b4c48bbb89
commit
6ed581436a
@ -157,26 +157,29 @@ class PlaneController extends PublicController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @description: 飞机在站点上注册航线
|
* @description: 飞机在站点上注册航线 或 注销航线
|
||||||
*/
|
*/
|
||||||
public function lockSite()
|
public function lockSite()
|
||||||
{
|
{
|
||||||
//总管理员 可接收任何shop_id 非总管理员 只可以调用自身shop_id 否则会中断
|
//总管理员 可接收任何shop_id 非总管理员 只可以调用自身shop_id 否则会中断
|
||||||
$this->isPower();
|
$this->isPower();
|
||||||
|
|
||||||
if ($_REQUEST['id'] && $_REQUEST['plane_id'] && $_REQUEST['runing']) {
|
if ($_REQUEST['id'] && $_REQUEST['runing']) {
|
||||||
$rsDb = D('receive_site');
|
$rsDb = D('receive_site');
|
||||||
$where['id'] = $_REQUEST['id'];
|
$where['id'] = $_REQUEST['id'];
|
||||||
$where['shop_id'] = $_REQUEST['shop_id'];
|
$where['shop_id'] = $_REQUEST['shop_id'];
|
||||||
//合法检查
|
//航线注册 合法检查 ps:注销跳过此步骤
|
||||||
$rsCheck = $rsDb->where($where)->select();
|
if ($_REQUEST['plane_id'] != "") { //注册航线调用接口时会传飞机id过来
|
||||||
foreach ($rsCheck as $key => $value) {
|
$rsCheck = $rsDb->where($where)->select();
|
||||||
$runingPlanes = explode(',', $value['runing']);
|
foreach ($rsCheck as $key => $value) {
|
||||||
if (in_array($_REQUEST['plane_id'], $runingPlanes)) {
|
$runingPlanes = explode(',', $value['runing']);
|
||||||
echo json_encode(array('status' => 0, 'msg' => '此飞机已经组测过航线了'));
|
if (in_array($_REQUEST['plane_id'], $runingPlanes)) {
|
||||||
exit;
|
echo json_encode(array('status' => 0, 'msg' => '此飞机已经注册过航线了!'));
|
||||||
|
exit;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//注册航线
|
//注册航线
|
||||||
if ($_REQUEST['runing'] == "null") {
|
if ($_REQUEST['runing'] == "null") {
|
||||||
$data['runing'] = null;
|
$data['runing'] = null;
|
||||||
|
Loading…
Reference in New Issue
Block a user