From 1a014e32c326fec0b1a561dc56df89bc1090cdd3 Mon Sep 17 00:00:00 2001 From: xnrcms <562909771@qq.com> Date: Thu, 20 Feb 2025 18:52:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dexcel=E8=A1=A8=E6=A0=BC?= =?UTF-8?q?=E5=AF=BC=E5=85=A5=E6=97=B6=E8=A1=A8=E5=A4=B4=E8=B6=85=E8=BF=87?= =?UTF-8?q?AA=E5=88=97=E4=B8=8D=E8=83=BD=E8=8E=B7=E5=8F=96=E5=88=B0?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Excel/PhpOffice.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Excel/PhpOffice.php b/src/Excel/PhpOffice.php index 951e353..83831cc 100644 --- a/src/Excel/PhpOffice.php +++ b/src/Excel/PhpOffice.php @@ -185,11 +185,14 @@ private function getDataByIndex($sheet, $endCell): array $data = []; foreach ($sheet->getActiveSheet()->getRowIterator(2) as $row) { $temp = []; + $propertyIndex = 0; foreach ($row->getCellIterator('A', $endCell) as $index => $item) { - $propertyIndex = ord($index) - 65; + //$propertyIndex = ord($index) - 65; if (isset($this->property[$propertyIndex])) { $temp[$this->property[$propertyIndex]['name']] = $item->getFormattedValue(); } + + $propertyIndex ++; } if (! empty($temp)) { $data[] = $temp;