## 城市列表
> 城市ID:获取该城市下的子城市,如果不携带该参数则代表不设置该条件
> 城市等级:获取指定等级的城市,如果不携带该参数则代表不设置该条件。等级参数:1=省,2=市,3=区
> 城市名称:采用模糊搜索,例如广州市,输入广州即可搜索出来广州市
> 每页显示数量:每页显示的城市数量,如果不携带该参数则代表输出全部。
~~~[api]
get:/city-list.json
int:pid#城市ID
int:level#城市等级
string:name#城市名称
int:limit#每页显示数量
<<<
有分页
{
"status": "success",
"msg": "获取成功",
"result": {
"total": 5,
"per_page": 2,
"current_page": 1,
"last_page": 3,
"data": [{
"id": 2,
"city_pid": 1,
"city_level": 2,
"city_name": "广州市",
"city_sort": 100,
"city_state": "1",
"city_time": "2018-03-23 14:20:37"
}, {
"id": 3,
"city_pid": 1,
"city_level": 2,
"city_name": "深圳市",
"city_sort": 100,
"city_state": "1",
"city_time": "2018-03-23 14:20:37"
}]
},
"page": {
"count": 2,
"current": 1,
"limit": 2,
"total": 3
}
}
<<<
无分页
{
"status": "success",
"msg": "获取成功",
"result": [{
"id": 2,
"city_pid": 1,
"city_level": 2,
"city_name": "广州市",
"city_sort": 100,
"city_state": "1",
"city_time": "2018-03-23 14:20:37"
}, {
"id": 3,
"city_pid": 1,
"city_level": 2,
"city_name": "深圳市",
"city_sort": 100,
"city_state": "1",
"city_time": "2018-03-23 14:20:37"
}, {
"id": 4,
"city_pid": 1,
"city_level": 2,
"city_name": "珠海市",
"city_sort": 100,
"city_state": "1",
"city_time": "2018-03-23 14:20:37"
}, {
"id": 5,
"city_pid": 1,
"city_level": 2,
"city_name": "韶关市",
"city_sort": 100,
"city_state": "1",
"city_time": "2018-03-23 14:20:37"
}, {
"id": 7,
"city_pid": 6,
"city_level": 2,
"city_name": "杭州市",
"city_sort": 100,
"city_state": "1",
"city_time": "2018-07-04 09:42:39"
}]
}
~~~
#### 字段列表
| 字段名 | 说明 |
| --- | --- |
| id | 标签ID |
| city_pid | 上级ID |
| city_level | 城市等级 |
| city_name | 城市名称 |