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 {
$row = [];
foreach ($item as $key => $value) {
$emptyRow = true;
$column = strtolower($title[$key]);
if ($columns === null || in_array($column, $columns)) {
$row[$column] = trim($value);
if(!empty($row[$column])){
$emptyRow = false;
}
}
}
if(!$emptyRow){
array_push($data, $row);
}
}
}
return $data;
}