Commit 0e8a12b6 authored by 王源's avatar 王源
Browse files

修改excel导入空判断和数值判断逻辑

parent 9caba02c
Loading
Loading
Loading
Loading
+6 −4
Original line number Original line Diff line number Diff line
@@ -121,14 +121,15 @@ class ExcelImporter
     * @param $errorCount
     * @param $errorCount
     * @throws \PhpOffice\PhpSpreadsheet\Exception
     * @throws \PhpOffice\PhpSpreadsheet\Exception
     */
     */
    public function checkRequire($requires, $errorCount)
    public function checkRequire($requires, &$errorCount)
    {
    {
        foreach ($requires as $k => $v) {
        foreach ($requires as $k => $v) {
            if ($v === '') {
            if (!$v || $v === '') {
                $this->setErrorMessage($k . "不能为空", $errorCount);
                $this->setErrorMessage($k . "不能为空", $errorCount);
                continue;
                return false;
            }
            }
        }
        }
        return true;
    }
    }


    /**
    /**
@@ -142,9 +143,10 @@ class ExcelImporter
        foreach ($data as $k => $v) {
        foreach ($data as $k => $v) {
            if (!is_numeric($v)) {
            if (!is_numeric($v)) {
                $this->setErrorMessage("{$k}只能是数字", $errorCount);
                $this->setErrorMessage("{$k}只能是数字", $errorCount);
                continue;
                return false;
            }
            }
        }
        }
        return true;
    }
    }


    /**
    /**