Skip to content

Commit 8d970e9

Browse files
committed
refactor: #72 use fast-excel instead of laravel excel
1 parent 5b5375f commit 8d970e9

File tree

6 files changed

+309
-1307
lines changed

6 files changed

+309
-1307
lines changed

Diff for: app/Commands/IssueImportCommand.php

+2-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@
44

55
use App\Coding\Issue;
66
use App\Coding\Project;
7-
use App\Imports\IssuesImport;
87
use LaravelZero\Framework\Commands\Command;
9-
use Maatwebsite\Excel\Facades\Excel;
8+
use Rap2hpoutre\FastExcel\Facades\FastExcel;
109

1110
class IssueImportCommand extends Command
1211
{
@@ -51,7 +50,7 @@ public function handle(Issue $codingIssue, Project $codingProject): int
5150
foreach ($result as $item) {
5251
$issueTypes[$item['Name']] = $item;
5352
}
54-
$rows = Excel::toArray(new IssuesImport(), $filePath)[0];
53+
$rows = FastExcel::import($filePath);
5554
foreach ($rows as $row) {
5655
$data = [
5756
'Type' => $issueTypes[$row['事项类型']]['IssueType'],

Diff for: app/Imports/IssuesImport.php

-14
This file was deleted.

Diff for: composer.json

+2-4
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,15 @@
2424
"ext-zip": "*",
2525
"illuminate/database": "^8.40",
2626
"illuminate/log": "^8.0",
27-
"illuminate/translation": "^8.64",
28-
"illuminate/validation": "^8.64",
2927
"laravel-fans/confluence": "^0.1.1",
3028
"laravel-zero/framework": "^8.8",
3129
"league/html-to-markdown": "^5.0",
32-
"maatwebsite/excel": "^3.1",
3330
"nesbot/carbon": "^2.53",
31+
"rap2hpoutre/fast-excel": "^3.1",
3432
"sinkcup/laravel-filesystem-cos-updated": "^4.0"
3533
},
3634
"require-dev": {
37-
"fakerphp/faker": "^1.9.1",
35+
"fakerphp/faker": "^1.16",
3836
"mockery/mockery": "^1.4.3",
3937
"phpmd/phpmd": "^2.10",
4038
"phpunit/phpunit": "^9.5",

0 commit comments

Comments
 (0)