Loading src/Manager/UploadManager.php +4 −4 Original line number Original line Diff line number Diff line Loading @@ -52,7 +52,7 @@ class UploadManager { { $excelOptions = [ $excelOptions = [ 'path' => 'excel', 'path' => 'excel', 'mime' => ['xlsx', 'xls'] 'mime' => ['xlsx', 'xls', 'csv'] ]; ]; $options = array_merge($excelOptions, $options); $options = array_merge($excelOptions, $options); return self::uploadFile($excel, $options); return self::uploadFile($excel, $options); Loading @@ -69,7 +69,7 @@ class UploadManager { { $excelOptions = [ $excelOptions = [ 'path' => 'excel', 'path' => 'excel', 'mime' => ['xlsx', 'xls'] 'mime' => ['xlsx', 'xls', 'csv'] ]; ]; $options = array_merge($excelOptions, $options); $options = array_merge($excelOptions, $options); return self::uploadFile($excel, $options, true); return self::uploadFile($excel, $options, true); Loading src/Tools/Exporter.php +6 −4 Original line number Original line Diff line number Diff line Loading @@ -216,7 +216,7 @@ class Exporter * @return Exporter * @return Exporter * @throws PhpSpreadsheetException * @throws PhpSpreadsheetException */ */ public function append(array $data, $keys = []) public function append(array $data, $keys = [], $noStyle = false) { { // 一维数组转二维 // 一维数组转二维 foreach ($data as $v) { foreach ($data as $v) { Loading @@ -233,8 +233,10 @@ class Exporter } } $this->sheet->fromArray($data, null, $this->beginColumnChar . $this->beginRowIndex); $this->sheet->fromArray($data, null, $this->beginColumnChar . $this->beginRowIndex); if (!$noStyle) { // 美化样式 // 美化样式 $this->applyStyle($this->beginColumnChar . $this->beginRowIndex . ":" . $this->sheet->getHighestColumn() . ($this->beginRowIndex + count($data) - 1)); $this->applyStyle($this->beginColumnChar . $this->beginRowIndex . ":" . $this->sheet->getHighestColumn() . ($this->beginRowIndex + count($data) - 1)); } $this->beginRowIndex += count($data); $this->beginRowIndex += count($data); return $this; return $this; } } Loading Loading
src/Manager/UploadManager.php +4 −4 Original line number Original line Diff line number Diff line Loading @@ -52,7 +52,7 @@ class UploadManager { { $excelOptions = [ $excelOptions = [ 'path' => 'excel', 'path' => 'excel', 'mime' => ['xlsx', 'xls'] 'mime' => ['xlsx', 'xls', 'csv'] ]; ]; $options = array_merge($excelOptions, $options); $options = array_merge($excelOptions, $options); return self::uploadFile($excel, $options); return self::uploadFile($excel, $options); Loading @@ -69,7 +69,7 @@ class UploadManager { { $excelOptions = [ $excelOptions = [ 'path' => 'excel', 'path' => 'excel', 'mime' => ['xlsx', 'xls'] 'mime' => ['xlsx', 'xls', 'csv'] ]; ]; $options = array_merge($excelOptions, $options); $options = array_merge($excelOptions, $options); return self::uploadFile($excel, $options, true); return self::uploadFile($excel, $options, true); Loading
src/Tools/Exporter.php +6 −4 Original line number Original line Diff line number Diff line Loading @@ -216,7 +216,7 @@ class Exporter * @return Exporter * @return Exporter * @throws PhpSpreadsheetException * @throws PhpSpreadsheetException */ */ public function append(array $data, $keys = []) public function append(array $data, $keys = [], $noStyle = false) { { // 一维数组转二维 // 一维数组转二维 foreach ($data as $v) { foreach ($data as $v) { Loading @@ -233,8 +233,10 @@ class Exporter } } $this->sheet->fromArray($data, null, $this->beginColumnChar . $this->beginRowIndex); $this->sheet->fromArray($data, null, $this->beginColumnChar . $this->beginRowIndex); if (!$noStyle) { // 美化样式 // 美化样式 $this->applyStyle($this->beginColumnChar . $this->beginRowIndex . ":" . $this->sheet->getHighestColumn() . ($this->beginRowIndex + count($data) - 1)); $this->applyStyle($this->beginColumnChar . $this->beginRowIndex . ":" . $this->sheet->getHighestColumn() . ($this->beginRowIndex + count($data) - 1)); } $this->beginRowIndex += count($data); $this->beginRowIndex += count($data); return $this; return $this; } } Loading