正在显示
1 个修改的文件
包含
5 行增加
和
5 行删除
| @@ -57,16 +57,16 @@ class UpdateProjectTdk extends Command | @@ -57,16 +57,16 @@ class UpdateProjectTdk extends Command | ||
| 57 | $noticeLogModel->edit(['status'=>$noticeLogModel::STATUS_SUCCESS],['id'=>$task_id]); | 57 | $noticeLogModel->edit(['status'=>$noticeLogModel::STATUS_SUCCESS],['id'=>$task_id]); |
| 58 | continue; | 58 | continue; |
| 59 | } | 59 | } |
| 60 | - if (!file_exists($url)) { | ||
| 61 | - dd(222222); | ||
| 62 | - continue; | ||
| 63 | - } | ||
| 64 | - dd($url); | ||
| 65 | // 载入 Excel | 60 | // 载入 Excel |
| 61 | + try { | ||
| 66 | $spreadsheet = IOFactory::load($url); | 62 | $spreadsheet = IOFactory::load($url); |
| 67 | $sheet = $spreadsheet->getActiveSheet(); | 63 | $sheet = $spreadsheet->getActiveSheet(); |
| 68 | $rows = $sheet->toArray(); | 64 | $rows = $sheet->toArray(); |
| 69 | dd($rows); | 65 | dd($rows); |
| 66 | + }catch (\Exception $e){ | ||
| 67 | + echo '文件打不开'.PHP_EOL; | ||
| 68 | + continue; | ||
| 69 | + } | ||
| 70 | // 假设第一行是表头 | 70 | // 假设第一行是表头 |
| 71 | $header = $rows[0]; | 71 | $header = $rows[0]; |
| 72 | $dataRows = array_slice($rows, 1); | 72 | $dataRows = array_slice($rows, 1); |
-
请 注册 或 登录 后发表评论