【类 型】:
【原 因】: 【过 程】: 【影 响】:
This commit is contained in:
parent
ac6c9e43a5
commit
c5044dc52c
@ -1022,6 +1022,46 @@ class PlaneController extends PublicController
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 删除指定的飞行数据记录
|
||||||
|
* @param string idArr 以逗号分隔的ID字符串
|
||||||
|
* @return json
|
||||||
|
*/
|
||||||
|
public function deleteFlyDataByIdArr()
|
||||||
|
{
|
||||||
|
if ($this->tokenShop_id != C('powerId')) { //非总管理员
|
||||||
|
$where['shop_id'] = $this->tokenShop_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取参数
|
||||||
|
$idArrStr = I('post.idArr', '', 'trim');
|
||||||
|
|
||||||
|
if (empty($idArrStr)) {
|
||||||
|
$this->ajaxReturn(array('status' => 0, 'msg' => '参数错误,idArr 不能为空'));
|
||||||
|
}
|
||||||
|
|
||||||
|
$idArr = explode(',', $idArrStr);
|
||||||
|
|
||||||
|
// 过滤非法ID
|
||||||
|
$idArr = array_filter($idArr, function ($id) {
|
||||||
|
return is_numeric($id);
|
||||||
|
});
|
||||||
|
|
||||||
|
if (empty($idArr)) {
|
||||||
|
$this->ajaxReturn(array('status' => 0, 'msg' => '参数错误,idArr 无有效 ID'));
|
||||||
|
}
|
||||||
|
|
||||||
|
$where['id'] = array('in', $idArr);
|
||||||
|
|
||||||
|
// 执行删除操作
|
||||||
|
$result = M('fly_data')->where($where)->delete();
|
||||||
|
|
||||||
|
if ($result === false) {
|
||||||
|
$this->ajaxReturn(array('status' => 0, 'msg' => '删除失败'));
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->ajaxReturn(array('status' => 1, 'msg' => '删除成功', 'deleted_count' => $result));
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* @description: 上传保存飞机飞行数据(从解锁到加锁)
|
* @description: 上传保存飞机飞行数据(从解锁到加锁)
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user