【类 型】:feat
【原 因】:删除地图样式 后端接口 【过 程】: 【影 响】:
This commit is contained in:
parent
48c825951c
commit
a3faf1604a
@ -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' => '删除失败']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user