From a3faf1604aadb1e6060583f3c7be23bde6fc436a Mon Sep 17 00:00:00 2001 From: air <30444667+sszdot@users.noreply.github.com> Date: Tue, 23 Sep 2025 14:10:44 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E7=B1=BB=20=20=E5=9E=8B=E3=80=91?= =?UTF-8?q?=EF=BC=9Afeat=20=E3=80=90=E5=8E=9F=20=20=E5=9B=A0=E3=80=91?= =?UTF-8?q?=EF=BC=9A=E5=88=A0=E9=99=A4=E5=9C=B0=E5=9B=BE=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=20=E5=90=8E=E7=AB=AF=E6=8E=A5=E5=8F=A3=20=E3=80=90=E8=BF=87=20?= =?UTF-8?q?=20=E7=A8=8B=E3=80=91=EF=BC=9A=20=E3=80=90=E5=BD=B1=20=20?= =?UTF-8?q?=E5=93=8D=E3=80=91=EF=BC=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/PlaneController.class.php | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) 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' => '删除失败']); + } + } }