rabin 2 years ago
parent
commit
b2441d35b0
1 changed files with 7 additions and 7 deletions
  1. 7 7
      service/option/lib/Import.php

+ 7 - 7
service/option/lib/Import.php

@@ -38,14 +38,14 @@ class Import
             foreach ($data as $k => $v) {
                 $state = preg_match(Dever::rule('mobile'), $v['C']);
                 if ($state) {
-                    $key = $v['A'];
-                    $where['key'] = $v['A'];
-                    $where['mobile'] = $v['C'];
+                    $key = trim($v['A']);
+                    $where['key'] = trim($v['A']);
+                    $where['mobile'] = trim($v['C']);
                     $where['clear'] = true;
                     $info = Dever::db('option/member')->find($where);
                     $update = $where;
-                    $update['idcard'] = $v['D'];
-                    $update['name'] = $v['B'];
+                    $update['idcard'] = trim($v['D']);
+                    $update['name'] = trim($v['B']);
                     $update['main'] = $v['E'] == 1 ? 1 : 2;
                     if (!$info) {
                         $update['status'] = 2;
@@ -231,7 +231,7 @@ class Import
                 if ($state) {
                     if ($v['C'] > 0) {
                         $where['clear'] = true;
-                        $where['mobile'] = $v['A'];
+                        $where['mobile'] = trim($v['A']);
                         $type_name = $v['D'];
                         if ($type_name == '期权') {
                             $type = 1;
@@ -306,7 +306,7 @@ class Import
                 $state = preg_match(Dever::rule('mobile'), $v['A']);
                 if ($state) {
                     if ($v['C'] > 0) {
-                        $where['mobile'] = $v['A'];
+                        $where['mobile'] = trim($v['A']);
                         $type_name = $v['D'];
                         if ($type_name == '期权') {
                             $type = 2;