Skip to content

超过AA列不能获取到数据 #1

@zazi523623

Description

@zazi523623

f9a469233b4cc4957757d30891aedca
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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions