省市区列表框 [areacity]

省市区三级数据联动列表框

使用前请先导入数据,如需更新数据,请前往 https://github.com/xiangyuecn/AreaCity-JsSpider-StatsGov 下载最新的地域数据

areacity:get($id)  获取id对应的地区信息

如:
C('areacity:get',330109);
返回:
Array
(
    [id] => 330109
    [pid] => 3301
    [deep] => 2
    [name] => 萧山
    [pinyin_prefix] => x
    [pinyin] => xiao shan
    [ext_id] => 330109000000
    [ext_name] => 萧山区
)

areacity:getParents($id)  获取id所有的父地区信息(包含自身)

如:
C('areacity:getParents',330109);

返回:

Array
(
    [0] => Array
        (
            [id] => 33
            [pid] => 0
            [deep] => 0
            [name] => 浙江
            [pinyin_prefix] => z
            [pinyin] => zhe jiang
            [ext_id] => 330000000000
            [ext_name] => 浙江省
        )

    [1] => Array
        (
            [id] => 3301
            [pid] => 33
            [deep] => 1
            [name] => 杭州
            [pinyin_prefix] => h
            [pinyin] => hang zhou
            [ext_id] => 330100000000
            [ext_name] => 杭州市
        )

    [2] => Array
        (
            [id] => 330109
            [pid] => 3301
            [deep] => 2
            [name] => 萧山
            [pinyin_prefix] => x
            [pinyin] => xiao shan
            [ext_id] => 330109000000
            [ext_name] => 萧山区
        )

)


areacity:getParentsName($id)  获取id对应的完整地区名称

如:

C('areacity:getParentsName',330109);
返回:
浙江省杭州市萧山区
应用信息
标识areacity
版本号1.3
文件大小71.9KB
发布时间2020-09-02
更新时间2024-01-27
PHP兼容--
作者 ClassCMS
安装
请在网站后台-应用商店内安装此应用.
也可在演示站点-应用商店内中安装并测试.
更新记录
1.3新增方法
1.2地区信息更新
1.1修复未选时返回false的bug