dever 3 年之前
父節點
當前提交
3bd3f747d6
共有 1 個文件被更改,包括 9 次插入2 次删除
  1. 9 2
      src/Address.php

+ 9 - 2
src/Address.php

@@ -77,13 +77,20 @@ class Address  extends Base
             } elseif (strstr($data['address'], '市')) {
             } elseif (strstr($data['address'], '市')) {
                 $temp = explode('市', $data['address']);
                 $temp = explode('市', $data['address']);
                 $data['province_name'] = $temp[0] . '市';
                 $data['province_name'] = $temp[0] . '市';
+                $city = '';
+                unset($temp[0]);
+                $city = implode('', $temp);
             } elseif (strstr($data['address'], '区')) {
             } elseif (strstr($data['address'], '区')) {
                 $temp = explode('区', $data['address']);
                 $temp = explode('区', $data['address']);
                 $data['province_name'] = $temp[0] . '区';
                 $data['province_name'] = $temp[0] . '区';
+
+                $city = '';
+                unset($temp[0]);
+                $city = implode('', $temp);
             }
             }
 
 
-            if (strstr($temp[1], '市')) {
-                $temp = explode('市', $temp[1]);
+            if (strstr($city, '市')) {
+                $temp = explode('市', $city);
                 $data['city_name'] = $temp[0] . '市';
                 $data['city_name'] = $temp[0] . '市';
             }
             }
             $data['county_name'] = $temp[1];
             $data['county_name'] = $temp[1];