From 3f09a388f3f61dde6ea905f44d888fe4c12ce85e Mon Sep 17 00:00:00 2001 From: cody <648753004@qq.com> Date: Tue, 16 Dec 2025 16:09:12 +0800 Subject: [PATCH] update --- app/Exports/CommonExport.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/app/Exports/CommonExport.php b/app/Exports/CommonExport.php index 1c982ff..b7f9104 100755 --- a/app/Exports/CommonExport.php +++ b/app/Exports/CommonExport.php @@ -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; } }