diff --git a/FlyCube/MpApi/Controller/PlaneController.class.php b/FlyCube/MpApi/Controller/PlaneController.class.php index 9f4e332..86f904a 100644 --- a/FlyCube/MpApi/Controller/PlaneController.class.php +++ b/FlyCube/MpApi/Controller/PlaneController.class.php @@ -1124,4 +1124,25 @@ class PlaneController extends PublicController )); } } + + /** + * @description: 修改地图样式的排序字段 + */ + public function orderMapStyle() + { + if (isset($_REQUEST['id']) && $_REQUEST['id'] !== '' && isset($_REQUEST['sort_order']) && $_REQUEST['sort_order'] !== '') { + $data['sort_order'] = (int)$_REQUEST['sort_order']; + // where 条件 + $where['id'] = $_REQUEST['id']; + // 录入数据库 + $mapStyleDb = D('map_styles'); + if ($mapStyleDb->where($where)->save($data) !== false) { + echo json_encode(array('status' => 1, 'msg' => '更新成功')); + } else { + echo json_encode(array('status' => 0, 'msg' => '更新失败')); + } + } else { + echo json_encode(array('status' => 0, 'msg' => '参数有误')); + } + } }