作者 lyh

GX生成白帽报表脚本

... ... @@ -57,11 +57,15 @@ class UpdateProjectTdk extends Command
$noticeLogModel->edit(['status'=>$noticeLogModel::STATUS_SUCCESS],['id'=>$task_id]);
continue;
}
// 下载到 Laravel storage 的临时路径
$tempPath = storage_path('app/temp_url.xlsx');
file_put_contents($tempPath, file_get_contents($url));
// 载入 Excel
// try {
$spreadsheet = IOFactory::load($url);
$spreadsheet = IOFactory::load($tempPath);
$sheet = $spreadsheet->getActiveSheet();
$rows = $sheet->toArray();
unlink($tempPath);
dd($rows);
// }catch (\Exception $e){
// echo '文件打不开'.PHP_EOL;
... ...