shensong00 hace 5 horas
padre
commit
74b62ae09d
Se han modificado 1 ficheros con 11 adiciones y 1 borrados
  1. 11 1
      app/Console/Commands/Test.php

+ 11 - 1
app/Console/Commands/Test.php

19
 use App\Models\OrderMcn;
19
 use App\Models\OrderMcn;
20
 use App\RedisModel;
20
 use App\RedisModel;
21
 use Illuminate\Console\Command;
21
 use Illuminate\Console\Command;
22
+use Maatwebsite\Excel\Facades\Excel;
22
 
23
 
23
 class Test extends Command
24
 class Test extends Command
24
 {
25
 {
29
     {
30
     {
30
         \DB::connection()->disableQueryLog();
31
         \DB::connection()->disableQueryLog();
31
 //        $this->exportData();
32
 //        $this->exportData();
32
-        $this->test();
33
+//        $this->test();
34
+        $this->importData();
33
     }
35
     }
34
 
36
 
35
     public function test() {
37
     public function test() {
74
         }
76
         }
75
     }
77
     }
76
 
78
 
79
+    public function importData() {
80
+        $file = public_path('测试.xlsx');
81
+        Excel::load($file, function($reader){
82
+            $data = $reader->all();
83
+            dd($data);
84
+        });
85
+    }
86
+
77
     public function exportData()
87
     public function exportData()
78
     {
88
     {
79
         $arr = [
89
         $arr = [