PHPackages                             ichynul/tpextareacity - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. ichynul/tpextareacity

ActiveLibrary[Framework](/categories/framework)

ichynul/tpextareacity
=====================

thinkphp extension

1.2.6(2mo ago)17671Apache-2.0PHP

Since Mar 14Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/hi-tpext/tpext-areacity)[ Packagist](https://packagist.org/packages/ichynul/tpextareacity)[ Docs](http://www.ynyysc.com/)[ RSS](/packages/ichynul-tpextareacity/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (6)DependenciesVersions (17)Used By (0)

tpextbuilder select 多级联动-省市区县乡镇四级城市数据
=====================================

[](#tpextbuilder-select-多级联动-省市区县乡镇四级城市数据)

安装
--

[](#安装)

### 方式1 composer 安装

[](#方式1-composer-安装)

```
composer require ichynul/tpextareacity
```

### 方式2 extend 安装

[](#方式2-extend-安装)

\[tpext.core\] 自`1.6.4|3.3.2|4.0.7`起，支持`extend`方式在线安装。

- 数据源  |
- 本扩展不会经常更新数据，需要的请自行下载\[ok\_data\_level4.csv\]文件导入。
- \[phpmyadmin\] 导入方法：选择 \[tp\_areacity\] 表，点 \[操作\] 菜单，`将数据表复制到(数据库名.数据表名)`，填个新表名如`tp_areacity1` \[执行\] 备份。
- \[操作\] 菜单-清空数据表 (TRUNCATE)，清空表数据。
- \[导入\] 菜单上传下载的 \[ok\_data\_level4.csv\] ，点 \[执行\] ，导入后删除第一行表头字段。

DEMO
----

[](#demo)

```
   $form->fields('省/市/区');
   $form->select('province', ' ', 4)->size(0, 12)->showLabel(false)->dataUrl(url('/api/areacity/province'), 'ext_name')->withNext(
            $form->select('city', ' ', 4)->size(0, 12)->showLabel(false)->dataUrl(url('/api/areacity/city'), 'ext_name')->withNext(
                $form->select('area', ' ', 4)->size(0, 12)->showLabel(false)->dataUrl(url('/api/areacity/area'), 'ext_name')
            )
        );
   $form->fieldsEnd();

   //或者
   $form->fields('省/市/区')->with(
       $form->select('province', ' ', 4)->size(0, 12)->showLabel(false)->dataUrl(url('/api/areacity/province'), 'ext_name')->withNext(
            $form->select('city', ' ', 4)->size(0, 12)->showLabel(false)->dataUrl(url('/api/areacity/city'), 'ext_name')->withNext(
                $form->select('area', ' ', 4)->size(0, 12)->showLabel(false)->dataUrl(url('/api/areacity/area'), 'ext_name')
            )
        );
   );
```

### webman 跨越设置

[](#webman-跨越设置)

由于 webman 通过控制器判断当前应用

`\tpext\areacity\api\controller\Areacity` 识别为 `areacity` 应用，而不是 `api`

```
return [
    // 全局中间件
    '' => [
    ],
    'api' => [
        \app\middleware\Cors::class,//跨域中间件（根据实际情况设置）
    ],
    'areacity' => [
        \app\middleware\Cors::class,//为areacity也设置一个跨域中间件
    ],
];
```

###  Health Score

48

—

FairBetter than 94% of packages

Maintenance87

Actively maintained with recent releases

Popularity18

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~148 days

Recently: every ~375 days

Total

16

Last Release

65d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/10061650?v=4)[ichynul](/maintainers/ichynul)[@ichynul](https://github.com/ichynul)

---

Top Contributors

[![ichynul](https://avatars.githubusercontent.com/u/10061650?v=4)](https://github.com/ichynul "ichynul (32 commits)")

---

Tags

thinkphp

### Embed Badge

![Health badge](/badges/ichynul-tpextareacity/health.svg)

```
[![Health](https://phpackages.com/badges/ichynul-tpextareacity/health.svg)](https://phpackages.com/packages/ichynul-tpextareacity)
```

###  Alternatives

[topthink/think

the new thinkphp framework

7.9k1.2M13](/packages/topthink-think)[topthink/framework

The ThinkPHP Framework.

2.8k3.3M1.4k](/packages/topthink-framework)[thinkcmf/thinkcmf

ThinkCMF based on ThinkPHP 8.x , it is a free and open source Content Management Framework(CMF)

2.2k19.5k](/packages/thinkcmf-thinkcmf)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
