区域
This commit is contained in:
parent
8b171b0e56
commit
74aee3779c
27
app/api/controller/CommonController.php
Normal file
27
app/api/controller/CommonController.php
Normal file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace app\api\controller;
|
||||
|
||||
use think\facade\Db;
|
||||
|
||||
class CommonController extends BaseApiController
|
||||
{
|
||||
public array $notNeedLogin = ['city','area','street'];
|
||||
|
||||
//**省份列表 */
|
||||
public function city(){
|
||||
$data = Db::name('geo_city')->where(['city_id'=>259])->select();
|
||||
return $this->data($data->toArray());
|
||||
}
|
||||
//**区域列表 */
|
||||
public function area(){
|
||||
$data = Db::name('geo_area')->where(['city_code'=>510500])->select();
|
||||
return $this->data($data->toArray());
|
||||
}
|
||||
//**街道列表 */
|
||||
public function street(){
|
||||
$data = Db::name('geo_street')->where(['area_code'=>510502])->select();
|
||||
return $this->data($data->toArray());
|
||||
}
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user