Compare commits

..

No commits in common. "bfadaeeb6e3a73e24f66c25e208eb03a2a907f2c" and "b4c48bbb89ffdbaea7f45e76c76cef2b0c135299" have entirely different histories.

View File

@ -157,32 +157,34 @@ class PlaneController extends PublicController
}
}
/**
* @description: 飞机在站点上注册航线 注销航线
* @description: 飞机在站点上注册航线
*/
public function lockSite()
{
//总管理员 可接收任何shop_id 非总管理员 只可以调用自身shop_id 否则会中断
$this->isPower();
if ($_REQUEST['id'] && $_REQUEST['shop_id'] && $_REQUEST['runing']) {
if ($_REQUEST['id'] && $_REQUEST['plane_id'] && $_REQUEST['runing']) {
$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;
}
//合法检查
$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 ($_REQUEST['runing'] == "null") {
$data['runing'] = null;
$msg = "已注销执行航线";
} else {
$data['runing'] = $_REQUEST['runing'];
$msg = "已注册执行航线";
}
if ($rsDb->where($where)->save($data)) {
echo json_encode(array('status' => 1, 'msg' => $msg));