Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
zazi523623 opened this issue Jun 12, 2024 · 0 comments
Open

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

zazi523623 opened this issue Jun 12, 2024 · 0 comments

Comments

@zazi523623
Copy link

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant