【类 型】:
【原 因】: 【过 程】: 【影 响】:
This commit is contained in:
parent
d6975cbd82
commit
1c0592d6e3
@ -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: 删除指定飞机
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user