This commit is contained in:
邓皓元 2019-05-20 09:40:34 +08:00
parent 375fc5ade5
commit f65ca6610f

View File

@ -34,15 +34,24 @@ class ImportService extends Service
} else { } else {
$row = []; $row = [];
foreach ($item as $key => $value) { foreach ($item as $key => $value) {
$emptyRow = true;
$column = strtolower($title[$key]); $column = strtolower($title[$key]);
if ($columns === null || in_array($column, $columns)) { if ($columns === null || in_array($column, $columns)) {
$row[$column] = trim($value); $row[$column] = trim($value);
if(!empty($row[$column])){
$emptyRow = false;
}
} }
} }
if(!$emptyRow){
array_push($data, $row); array_push($data, $row);
} }
} }
}
return $data; return $data;
} }