【类 型】:refactor
【主 题】:注销 注册接口 回滚到 检查注册飞机id是否重复合法 【描 述】: [原因]: [过程]: [影响]: 【结 束】 # 类型 包含: # feat:新功能(feature) # fix:修补bug # docs:文档(documentation) # style: 格式(不影响代码运行的变动) # refactor:重构(即不是新增功能,也不是修改bug的代码变动) # test:增加测试 # chore:构建过程或辅助工具的变动
This commit is contained in:
parent
69c3d94432
commit
b0eb50fc8d
@ -168,6 +168,20 @@ class PlaneController extends PublicController
|
||||
$rsDb = D('receive_site');
|
||||
$where['id'] = $_REQUEST['id'];
|
||||
$where['shop_id'] = $_REQUEST['shop_id'];
|
||||
//航线注册 合法检查 ps:注销跳过此步骤
|
||||
if ($_REQUEST['plane_id'] != "") { //注册航线调用接口时会传飞机id过来
|
||||
$rsCheck = $rsDb->where($where)->select();
|
||||
foreach ($rsCheck as $key => $value) {
|
||||
$runingPlanes = explode(',', $value['runing']);
|
||||
if (in_array($_REQUEST['plane_id'], $runingPlanes)) {
|
||||
echo json_encode(array('status' => 0, 'msg' => '此飞机已经注册过航线了!'));
|
||||
exit;
|
||||
}
|
||||
}
|
||||
$msg = "已注册执行航线";
|
||||
} else {
|
||||
$msg = "已注销执行航线";
|
||||
}
|
||||
$data['runing'] = $_REQUEST['runing'];
|
||||
|
||||
if ($rsDb->where($where)->save($data)) {
|
||||
|
Loading…
Reference in New Issue
Block a user