...
|
...
|
@@ -304,6 +304,10 @@ class House extends Api |
|
|
"data": {
|
|
|
"id"://市级id
|
|
|
"name"://市级名称
|
|
|
"children": [{
|
|
|
"id": //区级id
|
|
|
"name": //区级id
|
|
|
}]
|
|
|
}
|
|
|
]
|
|
|
}
|
...
|
...
|
@@ -311,11 +315,16 @@ class House extends Api |
|
|
*/
|
|
|
public function city_list()
|
|
|
{
|
|
|
// $page = $this->request->param('page', 1, 'intval');
|
|
|
// $pageNum = $this->request->param('pageNum', 10, 'intval');
|
|
|
$data['total_num'] = Db::name('area')->field('id,name')->where('level',2)->count();
|
|
|
$data['info'] = Db::name('area')->field('id,name')->where('level',2)->select();
|
|
|
$this->success('success',$data);
|
|
|
$total_num = Db::name('area')->field('id,name')->where('level',2)->count();
|
|
|
$city_list = Db::name('area')->field('id,name')->where('level',2)->select();
|
|
|
foreach ($city_list as &$v) {
|
|
|
$v['children'] = Db::name('area')
|
|
|
->where('level',3)
|
|
|
->where('pid',$v['id'])
|
|
|
->field('id,name')
|
|
|
->select();
|
|
|
}
|
|
|
$this->success('success',compact('total_num','city_list'));
|
|
|
|
|
|
}
|
|
|
|
...
|
...
|
|