From 73b874c72ad55eb9eef21c36160ac0de58f0189e Mon Sep 17 00:00:00 2001
From: quanwei <419654421@qq.com>
Date: Thu, 05 Feb 2026 10:30:43 +0800
Subject: [PATCH] 优化名片
---
admin/app/api/model/user/UserAddress.php | 42 ------------------------------------------
1 files changed, 0 insertions(+), 42 deletions(-)
diff --git a/admin/app/api/model/user/UserAddress.php b/admin/app/api/model/user/UserAddress.php
index 43dfd03..c7352fd 100644
--- a/admin/app/api/model/user/UserAddress.php
+++ b/admin/app/api/model/user/UserAddress.php
@@ -118,47 +118,5 @@
return (new static())->where($where)->find();
}
- /**
- * 整理地图选择的地址 by lyzflash
- */
- public function setLocationAddress($address)
- {
- $region = $this->checkPCA($address);
- $short_address = str_replace($region['province'] . $region['city'] . $region['area'], '', $address);
- if (in_array($region['province'], array('北京市', '天津市', '天津市', '天津市'))) {
- $region['area'] = $region['city'];
- $region['city'] = $region['province'];
- }
- $province_id = Region::getIdByName($region['province'], 1);
- $city_id = Region::getIdByName($region['city'], 2, $province_id);
- $region_id = Region::getIdByName($region['area'], 3, $city_id);
- return ['cityCode'=> [$province_id, $city_id, $region_id], 'region' => [$region['province'], $region['city'], $region['area']], 'short_address' => $short_address];
- }
-
- /**
- * 截取省市区 by lyzflash
- */
- private function checkPCA($address) {
- preg_match('/(.*?(省|自治区|北京市|天津市|上海市|重庆市))/', $address, $matches);
- if (count($matches) > 1) {
- $province = $matches[count($matches) - 2];
- $address = str_replace($province, '', $address);
- }
- preg_match('/(.*?(市|自治州|地区|区划|县))/', $address, $matches);
- if (count($matches) > 1) {
- $city = $matches[count($matches) - 2];
- $address = str_replace($city, '', $address);
- }
- preg_match('/(.*?(市|区|县))/', $address, $matches);
- if (count($matches) > 1) {
- $area = $matches[count($matches) - 2];
- $address = str_replace($area, '', $address);
- }
- return [
- 'province' => isset($province) ? $province : '',
- 'city' => isset($city) ? $city : '',
- 'area' => isset($area) ? $area : '',
- ];
- }
}
\ No newline at end of file
--
Gitblit v1.9.2