-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description

try {
foreach ($sheet->getActiveSheet()->getRowIterator(2) as $row) {
$temp = [];
foreach ($row->getCellIterator('A', $endCell) as $index => $item) {
$propertyIndex = ord($index) - 65;
if (isset($this->property[$propertyIndex])) {
$temp[$this->property[$propertyIndex]['name']] = $item->getFormattedValue();
}
}
if (! empty($temp)) {
$data[] = $temp;
}
}
unlink($tempFilePath);
} catch (\Throwable $e) {
unlink($tempFilePath);
throw new MineException($e->getMessage());
}
ord($index) - 65 来计算属性索引,仅适用于单个字符的列索引(A-Z)
Metadata
Metadata
Assignees
Labels
No labels