Commit 92b4c105 authored by 王源's avatar 王源 🎧

修改数字判断

parent 62b50b0f
...@@ -141,9 +141,13 @@ class ExcelImporter ...@@ -141,9 +141,13 @@ class ExcelImporter
public function checkNumeric($data, &$errorCount) public function checkNumeric($data, &$errorCount)
{ {
foreach ($data as $k => $v) { foreach ($data as $k => $v) {
if (!is_numeric($v)) { if (!$v || $v === '') {
$this->setErrorMessage("{$k}只能是数字", $errorCount); continue;
return false; } else {
if (!is_numeric($v)) {
$this->setErrorMessage("{$k}只能是数字", $errorCount);
return false;
}
} }
} }
return true; return true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment