Skip to content

Commit 6e3c523

Browse files
authored
Update Excel.php
1 parent 3ba70a6 commit 6e3c523

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/Utils/Excel.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@ public static function getSheet(Event $event): Worksheet
2323
return $sheet;
2424
}
2525

26+
public static function getSheetMaxRowAndColumn(Event $event): array
27+
{
28+
$sheet = Excel::getSheet($event);
29+
30+
return $sheet->getHighestRowAndColumn();
31+
}
32+
2633
/**
2734
* 处理导入数据的计算属性
2835
*
@@ -36,7 +43,7 @@ public static function handleCalculateSheet(Event $event)
3643
{
3744
$sheet = Excel::getSheet($event);
3845

39-
['row' => $maxRow, 'column' => $maxColName] = $sheet->getHighestRowAndColumn();
46+
['row' => $maxRow, 'column' => $maxColName] = Excel::getSheetMaxRowAndColumn($event);
4047

4148
// A=65
4249
$maxCol = ord($maxColName) - 64;
@@ -153,7 +160,7 @@ public static function handleRequireCellTextColorForRedAndHyperLink(Event $event
153160
{
154161
$sheet = Excel::getSheet($event);
155162

156-
['row' => $maxRow, 'column' => $maxColName] = $sheet->getHighestRowAndColumn();
163+
['row' => $maxRow, 'column' => $maxColName] = Excel::getSheetMaxRowAndColumn($event);
157164

158165
// A=65
159166
$maxCol = ord($maxColName) - 64;

0 commit comments

Comments
 (0)