|
@@ -225,26 +225,25 @@ class Stroage extends Model
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 表格文件转PDF
|
|
// 表格文件转PDF
|
|
|
-// if(in_array($fileType, ['xls','xlsx','doc','docx'])){
|
|
|
|
|
- if(in_array($fileType, ['xls','xlsx'])){
|
|
|
|
|
|
|
+ if(in_array($fileType, ['xls','xlsx','doc','docx'])){
|
|
|
|
|
+// if(in_array($fileType, ['xls','xlsx'])){
|
|
|
$file = Stroage::convertFile($file);
|
|
$file = Stroage::convertFile($file);
|
|
|
return Stroage::getPdfFilePage($file);
|
|
return Stroage::getPdfFilePage($file);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 其他文件
|
|
// 其他文件
|
|
|
$fileTypes = config('files.fileTypes');
|
|
$fileTypes = config('files.fileTypes');
|
|
|
-// $fileTypes = $fileTypes? $fileTypes : ['doc','docx','ppt','pptx'];
|
|
|
|
|
- $fileTypes = $fileTypes? $fileTypes : ['ppt','pptx'];
|
|
|
|
|
|
|
+ $fileTypes = $fileTypes? $fileTypes : ['doc','docx','ppt','pptx'];
|
|
|
|
|
+// $fileTypes = $fileTypes? $fileTypes : ['ppt','pptx'];
|
|
|
if(!in_array($fileType, $fileTypes)){
|
|
if(!in_array($fileType, $fileTypes)){
|
|
|
return 0;
|
|
return 0;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- echo $file."\n";
|
|
|
|
|
// doc转docx
|
|
// doc转docx
|
|
|
- if($fileType == 'doc'){
|
|
|
|
|
|
|
+ /*if($fileType == 'doc'){
|
|
|
$file = Stroage::convertFile($file, 'docx');
|
|
$file = Stroage::convertFile($file, 'docx');
|
|
|
- }
|
|
|
|
|
-echo $file."\n";
|
|
|
|
|
|
|
+ }*/
|
|
|
|
|
+//echo $file."\n";
|
|
|
$zipFile = Stroage::moveFileToZip($file);
|
|
$zipFile = Stroage::moveFileToZip($file);
|
|
|
if(!is_file($zipFile)){
|
|
if(!is_file($zipFile)){
|
|
|
return 0;
|
|
return 0;
|