|
|
|
@ -396,10 +396,19 @@ class CommonExport implements FromCollection, WithStyles, WithColumnWidths, With
|
|
|
|
$header = array_values($this->fields);
|
|
|
|
$header = array_values($this->fields);
|
|
|
|
$moreFileds = [];
|
|
|
|
$moreFileds = [];
|
|
|
|
if (empty($clear)) {
|
|
|
|
if (empty($clear)) {
|
|
|
|
if (isset($this->data[0]['data']) && is_array($this->data[0]['data'])) {
|
|
|
|
// 容错,取前三个数据
|
|
|
|
$moreHeader = array_column($this->data[0]['data'], 'name');
|
|
|
|
$otherData = ($this->data[0]['data'] ?? null);
|
|
|
|
|
|
|
|
if (empty($otherData)) {
|
|
|
|
|
|
|
|
$otherData = ($this->data[1]['data'] ?? null);
|
|
|
|
|
|
|
|
if (empty($otherData)) {
|
|
|
|
|
|
|
|
$otherData = ($this->data[2]['data'] ?? null);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (isset($otherData) && is_array($otherData)) {
|
|
|
|
|
|
|
|
$moreHeader = array_column($otherData, 'name');
|
|
|
|
$header = array_merge($header, $moreHeader);
|
|
|
|
$header = array_merge($header, $moreHeader);
|
|
|
|
$moreFileds = array_column($this->data[0]['data'], 'field');
|
|
|
|
$moreFileds = array_column($otherData, 'field');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$newList[] = $header;
|
|
|
|
$newList[] = $header;
|
|
|
|
|