master
cody 5 days ago
parent b6fe64e629
commit 3f09a388f3

@ -396,12 +396,11 @@ class CommonExport implements FromCollection, WithStyles, WithColumnWidths, With
$header = array_values($this->fields);
$moreFileds = [];
if (empty($clear)) {
// 容错,取前三个数据
$otherData = ($this->data[0]['data'] ?? null);
if (empty($otherData)) {
$otherData = ($this->data[1]['data'] ?? null);
if (empty($otherData)) {
$otherData = ($this->data[2]['data'] ?? null);
// 容错,取数据不是空的数组
foreach ($this->data as $value) {
if (!empty($value['data'])) {
$otherData = $value['data'];
break;
}
}

Loading…
Cancel
Save