diff --git a/FlyCube/MpApi/Controller/PlaneController.class.php b/FlyCube/MpApi/Controller/PlaneController.class.php index d28cacc..381aad7 100644 --- a/FlyCube/MpApi/Controller/PlaneController.class.php +++ b/FlyCube/MpApi/Controller/PlaneController.class.php @@ -1037,7 +1037,8 @@ class PlaneController extends PublicController $idArrStr = I('post.idArr', '', 'trim'); if (empty($idArrStr)) { - $this->ajaxReturn(array('status' => 0, 'msg' => '参数错误,idArr 不能为空')); + echo json_encode(array('status' => 0, 'msg' => '参数错误,idArr 不能为空')); + exit; } $idArr = explode(',', $idArrStr); @@ -1048,19 +1049,19 @@ class PlaneController extends PublicController }); if (empty($idArr)) { - $this->ajaxReturn(array('status' => 0, 'msg' => '参数错误,idArr 无有效 ID')); + echo json_encode(array('status' => 0, 'msg' => '参数错误,idArr 无有效 ID')); + exit; } $where['id'] = array('in', $idArr); // 执行删除操作 - $result = M('flight_log')->where($where)->delete(); - - if ($result === false) { - $this->ajaxReturn(array('status' => 0, 'msg' => '删除失败')); + $flight_logDb = D('flight_log'); + if ($flight_logDb->where($where)->delete()) { + echo json_encode(array('status' => 1, 'msg' => '删除成功')); + } else { + echo json_encode(array('status' => 0, 'msg' => '删除失败')); } - - $this->ajaxReturn(array('status' => 1, 'msg' => '删除成功', 'deleted_count' => $result)); } /** * @description: 上传保存飞机飞行数据(从解锁到加锁)