|
|
|
|
@ -29,6 +29,7 @@ class CommonExport implements FromCollection
|
|
|
|
|
*/
|
|
|
|
|
public function collection()
|
|
|
|
|
{
|
|
|
|
|
$clear = request('clear', 0);
|
|
|
|
|
if (empty($this->fields)) {
|
|
|
|
|
throw new ErrorException('导出字段不能为空');
|
|
|
|
|
}
|
|
|
|
|
@ -63,6 +64,7 @@ class CommonExport implements FromCollection
|
|
|
|
|
}
|
|
|
|
|
// 如果有自定义数据,全部附件上去
|
|
|
|
|
$t2 = [];
|
|
|
|
|
if (empty($clear)) {
|
|
|
|
|
if (isset($info['data']) && $info['data'] && !empty($moreFileds)) {
|
|
|
|
|
$dataCollect = collect($info['data']);
|
|
|
|
|
foreach ($moreFileds as $moreFiled) {
|
|
|
|
|
@ -74,6 +76,7 @@ class CommonExport implements FromCollection
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
$newList[] = $temp + $t2;
|
|
|
|
|
}
|
|
|
|
|
array_unshift($newList, $header); //插入表头
|
|
|
|
|
|