diff --git a/FlyCube/MpApi/Controller/PlaneController.class.php b/FlyCube/MpApi/Controller/PlaneController.class.php index cf9e0d4..cc911d6 100644 --- a/FlyCube/MpApi/Controller/PlaneController.class.php +++ b/FlyCube/MpApi/Controller/PlaneController.class.php @@ -1211,4 +1211,35 @@ class PlaneController extends PublicController echo json_encode(['status' => 0, 'msg' => '更新失败']); } } + + /** + * @description: 删除地图样式 + */ + public function delMapStyle() + { + if (!isset($_REQUEST['id']) || $_REQUEST['id'] === '') { + echo json_encode(['status' => 0, 'msg' => '参数缺失: id']); + return; + } + + $ids = explode(',', $_REQUEST['id']); + $ids = array_filter($ids, function($id) { + return is_numeric($id) && $id > 0; + }); + + if (empty($ids)) { + echo json_encode(['status' => 0, 'msg' => '无效的ID参数']); + return; + } + + $db = D('map_styles'); + $where['id'] = ['in', $ids]; + $result = $db->where($where)->delete(); + + if ($result !== false) { + echo json_encode(['status' => 1, 'msg' => '删除成功', 'deleted' => $result]); + } else { + echo json_encode(['status' => 0, 'msg' => '删除失败']); + } + } }