shensong00 6 時間 前
コミット
618030e1cc
共有1 個のファイルを変更した1 個の追加1 個の削除を含む
  1. 1 1
      app/Console/Commands/Test.php

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

79
     public function importData() {
79
     public function importData() {
80
         $file = public_path('测试.xlsx');
80
         $file = public_path('测试.xlsx');
81
         $objPHPExcel = \PHPExcel_IOFactory::load($file);
81
         $objPHPExcel = \PHPExcel_IOFactory::load($file);
82
-        $sheet = $objPHPExcel->getSheet('非销售'); // 读取第一个工作表
82
+        $sheet = $objPHPExcel->getSheet(0); // 读取第一个工作表
83
 //        $highestRow = $sheet->getHighestRow(); // 取得总行数
83
 //        $highestRow = $sheet->getHighestRow(); // 取得总行数
84
         for ($row = 3; $row <= 3; $row ++) { // 行数是以第1行开始
84
         for ($row = 3; $row <= 3; $row ++) { // 行数是以第1行开始
85
             echo 'A: ' . trim($sheet->getCell('A' . $row)->getFormattedValue()).PHP_EOL;
85
             echo 'A: ' . trim($sheet->getCell('A' . $row)->getFormattedValue()).PHP_EOL;