mtsung/twdd.location
Composer 安装命令:
composer require mtsung/twdd.location
包简介
a taiwan location tool
README 文档
README
for Laravel >= 6
Install
composer require mtsung/twdd.location
Lumen
bootstrap/app.php file:
$app->register(\Mtsung\TwddLocation\TwddLocationServiceProvider::class);
使用方式
使用經緯度查詢縣市鄉鎮區
use Mtsung\TwddLocation\Facade\TwddLocation; $res = TwddLocation::getCity(25.03375, 121.564879); /* array:2 [ "city_code" => "63000" "city_name" => "臺北市" ] */ $res = TwddLocation::getDistrict(25.077741, 121.574829); /* array:4 [ "city_code" => "63000" "city_name" => "臺北市" "district_code" => "63000100" "district_name" => "內湖區" "zip_code" => "114" ] */ $res = TwddLocation::getCity(34.92475,135.79863); // null $res = TwddLocation::getDistrict(39.256422, 140.986340); // null
使用 zip code 或 district code 查詢鄉鎮區
use Mtsung\TwddLocation\Facade\TwddDistrict; $res = TwddDistrict::getInfoByZipCode(238); /* array:5 [ "city_code" => "65000" "city_name" => "新北市" "district_code" => "65000070" "district_name" => "樹林區" "zip_code" => "238" ] */ $res = TwddDistrict::getInfoByZipCode(114); /* array:5 [ "city_code" => "63000" "city_name" => "臺北市" "district_code" => "63000100" "district_name" => "內湖區" "zip_code" => "114" ] */ $res = TwddDistrict::getInfoByZipCode(9999); // null $res = TwddDistrict::getInfoByDistrictCode(67000300); /* array:5 [ "city_code" => "67000" "city_name" => "臺南市" "district_code" => "67000300" "district_name" => "龍崎區" "zip_code" => "719" ] */ $res = TwddDistrict::getInfoByDistrictCode(9999); // null
資料來源
License
mtsung/twdd.location 适用场景与选型建议
mtsung/twdd.location 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 259 次下载、GitHub Stars 达 1, 最近一次更新时间为 2021 年 12 月 05 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 mtsung/twdd.location 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 mtsung/twdd.location 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 259
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-12-05