rabin 1 year ago
parent
commit
1067e191d0
1 changed files with 13 additions and 4 deletions
  1. 13 4
      src/Dever/Store/Mongo.php

+ 13 - 4
src/Dever/Store/Mongo.php

@@ -204,9 +204,13 @@ class Mongo extends Base
             if ($field && empty($field[$k]) && strpos('id,cdate', $k) === false) {
                 continue;
             }
+            /*
             if (is_numeric($v)) {
-                $v = (float) $v;
-            }
+                if (isset($field[$k]) && strpos($field[$k]['type'], 'char')) {
+                } else {
+                    $v = (float) $v;
+                }
+            }*/
             $insert[$k] = $v;
         }
         if ($field) {
@@ -237,9 +241,13 @@ class Mongo extends Base
             if ($field && empty($field[$k]) && strpos('id,cdate', $k) === false) {
                 continue;
             }
+            /*
             if (is_numeric($v)) {
-                $v = (float) $v;
-            }
+                if (isset($field[$k]) && strpos($field[$k]['type'], 'char')) {
+                } else {
+                    $v = (float) $v;
+                }
+            }*/
             $update[$k] = $v;
         }
         $update = array('$set' => $update);
@@ -380,6 +388,7 @@ class Mongo extends Base
     private function handle($v)
     {
         $v = (array)$v;
+        # 后续删除
         foreach ($v as &$v1) {
             if (is_numeric($v1) && strstr($v1, 'E')) {
                 $v1 = number_format($v1, 0, '', '');