【类 型】:

【原  因】:
【过  程】:
【影  响】:
This commit is contained in:
air 2025-06-19 14:58:59 +08:00
parent d6975cbd82
commit 1c0592d6e3

View File

@ -199,17 +199,20 @@ class PlaneController extends PublicController
*/ */
public function addAir() public function addAir()
{ {
//总管理员 可接收任何shop_id 非总管理员 只可以调用自身shop_id 否则会中断
$this->isPower(); $this->isPower();
if ($_REQUEST['shop_id'] && $_REQUEST['name'] && $_REQUEST['date']) { if ($_REQUEST['shop_id'] && $_REQUEST['name'] && $_REQUEST['date']) {
$data['shop_id'] = $_REQUEST['shop_id']; $data['shop_id'] = $_REQUEST['shop_id'];
$data['name'] = $_REQUEST['name']; $data['name'] = $_REQUEST['name'];
$data['onoff'] = $_REQUEST['onoff']; $data['onoff'] = $_REQUEST['onoff'];
$data['apply_time'] = substr($_REQUEST['date'], 0, -3); $data['apply_time'] = substr($_REQUEST['date'], 0, -3);
if ($_REQUEST['desc']) { if ($_REQUEST['desc']) {
$data['describe'] = $_REQUEST['desc']; $data['describe'] = $_REQUEST['desc'];
} }
if ($_REQUEST['bind_class_id']) {
$data['bind_class_id'] = $_REQUEST['bind_class_id'];
}
$airDb = D('airplane_register'); $airDb = D('airplane_register');
if ($airDb->data($data)->add()) { if ($airDb->data($data)->add()) {
echo json_encode(array('status' => 1, 'msg' => '创建成功')); echo json_encode(array('status' => 1, 'msg' => '创建成功'));
@ -225,20 +228,24 @@ class PlaneController extends PublicController
*/ */
public function saveAir() public function saveAir()
{ {
//总管理员 可接收任何shop_id 非总管理员 只可以调用自身shop_id 否则会中断
$this->isPower(); $this->isPower();
if ($_REQUEST['shop_id'] && $_REQUEST['name'] && $_REQUEST['id']) { if ($_REQUEST['shop_id'] && $_REQUEST['name'] && $_REQUEST['id']) {
$data['name'] = $_REQUEST['name']; $data['name'] = $_REQUEST['name'];
$data['onoff'] = $_REQUEST['onoff']; $data['onoff'] = $_REQUEST['onoff'];
$data['apply_time'] = substr($_REQUEST['date'], 0, -3); $data['apply_time'] = substr($_REQUEST['date'], 0, -3);
if ($_REQUEST['desc']) { if ($_REQUEST['desc']) {
$data['describe'] = $_REQUEST['desc']; $data['describe'] = $_REQUEST['desc'];
} else { } else {
$data['describe'] = null; $data['describe'] = null;
} }
if ($_REQUEST['bind_class_id']) {
$data['bind_class_id'] = $_REQUEST['bind_class_id'];
}
$where['id'] = $_REQUEST['id']; $where['id'] = $_REQUEST['id'];
$where['shop_id'] = $_REQUEST['shop_id']; $where['shop_id'] = $_REQUEST['shop_id'];
$airDb = D('airplane_register'); $airDb = D('airplane_register');
if ($airDb->where($where)->save($data)) { if ($airDb->where($where)->save($data)) {
echo json_encode(array('status' => 1, 'msg' => '更新成功')); echo json_encode(array('status' => 1, 'msg' => '更新成功'));
@ -249,6 +256,7 @@ class PlaneController extends PublicController
echo json_encode(array('status' => 0, 'msg' => '参数有误')); echo json_encode(array('status' => 0, 'msg' => '参数有误'));
} }
} }
/** /**
* @description: 删除指定飞机 * @description: 删除指定飞机
*/ */