地区接口

This commit is contained in:
chenbo 2024-01-09 14:56:05 +08:00
parent d1a3dc08f7
commit 927ab3bc8b
1 changed files with 2 additions and 1 deletions

View File

@ -13,6 +13,7 @@
class GeoController extends BaseLikeAdminController class GeoController extends BaseLikeAdminController
{ {
public array $notNeedLogin=['province','city', 'county','towns','villages','groups'];
// 获取省份 // 获取省份
public function province(): Json public function province(): Json
{ {
@ -49,7 +50,7 @@
if(empty($county_code)){ if(empty($county_code)){
return $this->fail('请选择区县'); return $this->fail('请选择区县');
} }
$data = Town::field('town_code,town_name')->where('county_code',$county_code)->select(); $data = Town::field('town_code,town_name,lng,lat')->where('county_code',$county_code)->select();
return $this->success('请求成功',$data->toArray()); return $this->success('请求成功',$data->toArray());
} }