diff --git a/FlyCube/MpApi/Controller/PlaneController.class.php b/FlyCube/MpApi/Controller/PlaneController.class.php index 521ccd8..df16870 100644 --- a/FlyCube/MpApi/Controller/PlaneController.class.php +++ b/FlyCube/MpApi/Controller/PlaneController.class.php @@ -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)) {