From 1c0592d6e37c4d5e8601f7b765c47421cc0ae409 Mon Sep 17 00:00:00 2001 From: air <30444667+sszdot@users.noreply.github.com> Date: Thu, 19 Jun 2025 14:58:59 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E7=B1=BB=20=20=E5=9E=8B=E3=80=91?= =?UTF-8?q?=EF=BC=9A=20=E3=80=90=E5=8E=9F=20=20=E5=9B=A0=E3=80=91=EF=BC=9A?= =?UTF-8?q?=20=E3=80=90=E8=BF=87=20=20=E7=A8=8B=E3=80=91=EF=BC=9A=20?= =?UTF-8?q?=E3=80=90=E5=BD=B1=20=20=E5=93=8D=E3=80=91=EF=BC=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MpApi/Controller/PlaneController.class.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/FlyCube/MpApi/Controller/PlaneController.class.php b/FlyCube/MpApi/Controller/PlaneController.class.php index 4966e96..3e57256 100644 --- a/FlyCube/MpApi/Controller/PlaneController.class.php +++ b/FlyCube/MpApi/Controller/PlaneController.class.php @@ -199,17 +199,20 @@ class PlaneController extends PublicController */ public function addAir() { - //总管理员 可接收任何shop_id 非总管理员 只可以调用自身shop_id 否则会中断 $this->isPower(); if ($_REQUEST['shop_id'] && $_REQUEST['name'] && $_REQUEST['date']) { $data['shop_id'] = $_REQUEST['shop_id']; $data['name'] = $_REQUEST['name']; - $data['onoff'] = $_REQUEST['onoff']; + $data['onoff'] = $_REQUEST['onoff']; $data['apply_time'] = substr($_REQUEST['date'], 0, -3); if ($_REQUEST['desc']) { $data['describe'] = $_REQUEST['desc']; } + if ($_REQUEST['bind_class_id']) { + $data['bind_class_id'] = $_REQUEST['bind_class_id']; + } + $airDb = D('airplane_register'); if ($airDb->data($data)->add()) { echo json_encode(array('status' => 1, 'msg' => '创建成功')); @@ -225,20 +228,24 @@ class PlaneController extends PublicController */ public function saveAir() { - //总管理员 可接收任何shop_id 非总管理员 只可以调用自身shop_id 否则会中断 $this->isPower(); if ($_REQUEST['shop_id'] && $_REQUEST['name'] && $_REQUEST['id']) { $data['name'] = $_REQUEST['name']; - $data['onoff'] = $_REQUEST['onoff']; + $data['onoff'] = $_REQUEST['onoff']; $data['apply_time'] = substr($_REQUEST['date'], 0, -3); if ($_REQUEST['desc']) { $data['describe'] = $_REQUEST['desc']; } else { $data['describe'] = null; } + if ($_REQUEST['bind_class_id']) { + $data['bind_class_id'] = $_REQUEST['bind_class_id']; + } + $where['id'] = $_REQUEST['id']; $where['shop_id'] = $_REQUEST['shop_id']; + $airDb = D('airplane_register'); if ($airDb->where($where)->save($data)) { echo json_encode(array('status' => 1, 'msg' => '更新成功')); @@ -249,6 +256,7 @@ class PlaneController extends PublicController echo json_encode(array('status' => 0, 'msg' => '参数有误')); } } + /** * @description: 删除指定飞机 */