增强空值导入的处理

This commit is contained in:
wlx 2015-02-02 13:57:55 +00:00
parent 61755cfbec
commit 508b076a38
1 changed files with 4 additions and 2 deletions

View File

@ -117,7 +117,7 @@ class Csv extends AbstractProcessing implements ProcessingInterface{
$t1=gettype($var1);
$t2=gettype($var2);
if ($t1==$t2) return true;
if (emtpy($var1) || emtpy($var2))
if ($var1=="" || $var2=="")
return true;
if (($t1=='integer' || $t1=='double') && ($t2=='integer' || $t2=='double'))
return true;
@ -222,6 +222,8 @@ class Csv extends AbstractProcessing implements ProcessingInterface{
foreach($this->getLines() as $line)
{
foreach($line as $k=>$v)
if ($v=="") $line[$k]=null;
$sth->execute($line);
}
@ -234,4 +236,4 @@ class Csv extends AbstractProcessing implements ProcessingInterface{
return true;
}
}
}