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

+ 5 - 4
src/Import.php

@@ -36,7 +36,7 @@ class Import
         if (isset($result[1]) && isset($result[2])) {
         if (isset($result[1]) && isset($result[2])) {
             foreach ($result[2] as $k => $v) {
             foreach ($result[2] as $k => $v) {
                 $update['id'] = $this->id(trim($result[1][$k], '.html'));
                 $update['id'] = $this->id(trim($result[1][$k], '.html'));
-                $update['name'] = $v;
+                $update['name'] = strip_tags($v);
                 $this->pinyin($update);
                 $this->pinyin($update);
                 $id = Dever::upinto('area/province', $update, $update);
                 $id = Dever::upinto('area/province', $update, $update);
 
 
@@ -59,6 +59,7 @@ class Import
         $update = array();
         $update = array();
         if (isset($result[3]) && isset($result[4])) {
         if (isset($result[3]) && isset($result[4])) {
             foreach ($result[4] as $k => $v) {
             foreach ($result[4] as $k => $v) {
+                $v = strip_tags($v);
                 if ($v == '市辖区') {
                 if ($v == '市辖区') {
                     $v = $province_name;
                     $v = $province_name;
                 }
                 }
@@ -92,7 +93,7 @@ class Import
         if (isset($result[3]) && isset($result[4])) {
         if (isset($result[3]) && isset($result[4])) {
             foreach ($result[4] as $k => $v) {
             foreach ($result[4] as $k => $v) {
                 $update['id'] = $this->id($result[2][$k]);
                 $update['id'] = $this->id($result[2][$k]);
-                $update['name'] = $v;
+                $update['name'] = strip_tags($v);
                 $update['city_id'] = $city;
                 $update['city_id'] = $city;
                 $update['province_id'] = $province;
                 $update['province_id'] = $province;
                 $update['area'] = $province . ',' . $city;
                 $update['area'] = $province . ',' . $city;
@@ -144,7 +145,7 @@ class Import
         if (isset($result[3]) && isset($result[4])) {
         if (isset($result[3]) && isset($result[4])) {
             foreach ($result[4] as $k => $v) {
             foreach ($result[4] as $k => $v) {
                 $update['id'] = $this->id($result[2][$k], 9);
                 $update['id'] = $this->id($result[2][$k], 9);
-                $update['name'] = $v;
+                $update['name'] = strip_tags($v);
                 $update['county_id'] = $county;
                 $update['county_id'] = $county;
                 $update['city_id'] = $city;
                 $update['city_id'] = $city;
                 $update['province_id'] = $province;
                 $update['province_id'] = $province;
@@ -173,7 +174,7 @@ class Import
             foreach ($result[3] as $k => $v) {
             foreach ($result[3] as $k => $v) {
                 $update['id'] = $this->id($result[1][$k], 12);
                 $update['id'] = $this->id($result[1][$k], 12);
                 $update['code'] = $result[2][$k];
                 $update['code'] = $result[2][$k];
-                $update['name'] = $v;
+                $update['name'] = strip_tags($v);
                 $update['town_id'] = $town;
                 $update['town_id'] = $town;
                 $update['county_id'] = $county;
                 $update['county_id'] = $county;
                 $update['city_id'] = $city;
                 $update['city_id'] = $city;