29 lines
782 B
PHP
29 lines
782 B
PHP
<?php
|
|
|
|
namespace app\adminapi\controller;
|
|
|
|
use think\facade\Db;
|
|
|
|
class CommonController extends BaseAdminController
|
|
{
|
|
public array $notNeedLogin = ['city', 'area', 'street'];
|
|
|
|
//**省列表 */
|
|
public function province()
|
|
{
|
|
$data = Db::name('geo_province')->where(['switch' => 1])->select();
|
|
return $this->data($data->toArray());
|
|
} //**市列表 */
|
|
public function city($province_code)
|
|
{
|
|
$data = Db::name('geo_city')->where(['province_code' => $province_code])->select();
|
|
return $this->data($data->toArray());
|
|
}
|
|
//**区域列表 */
|
|
public function area($city_code)
|
|
{
|
|
$data = Db::name('geo_area')->where(['city_code' => $city_code])->select();
|
|
return $this->data($data->toArray());
|
|
}
|
|
}
|