输出文件流

This commit is contained in:
2025-08-05 15:16:05 +08:00
parent 46c6a950e0
commit 1c040943ed
2 changed files with 26 additions and 14 deletions
+10 -7
View File
@@ -248,15 +248,18 @@ class CustomerService
// 创建Excel写入器
$writer = new Xlsx($spreadsheet);
$writer->save($filepath);
// $writer->save($filepath);
$writer->save('php://output');
$excelContent = ob_get_clean();
return $excelContent;
// 返回文件信息
return [
'filename' => $filename,
'filepath' => $filepath,
'size' => filesize($filepath),
'count' => count($customers)
];
// return [
// 'filename' => $filename,
// 'filepath' => $filepath,
// 'size' => filesize($filepath),
// 'count' => count($customers)
// ];
}
/**