wesmiler hace 6 años
padre
commit
cf207dcf41
Se han modificado 1 ficheros con 8 adiciones y 7 borrados
  1. 8 7
      vendor/thinkcmf/cmf-app/src/weixin/model/Stroage.php

+ 8 - 7
vendor/thinkcmf/cmf-app/src/weixin/model/Stroage.php

@@ -243,17 +243,18 @@ class Stroage extends Model
         $typeData = config('files.convertTypes');
         $typeData = $typeData ? array_keys($typeData) : ['doc','docx', 'xls', 'xlsx', 'ppt', 'pptx'];
         if (in_array($fileType, $typeData)) {
-            $file = Stroage::onLineConvertFile($file);
-
-            if($fileType == 'docx' && !$file){
-                $file = Stroage::convertFile($file,'doc');
-            } else if(!$file && ($fileType == 'xls' || $fileType == 'xlsx')){
+            $cfile = Stroage::onLineConvertFile($file);
+            saveLogCache('convert1', ['file'=> $file,'cfile'=> $cfile,'fileType'=> $fileType]);
+            if($fileType == 'docx' && !$cfile){
+                $cfile = Stroage::convertFile($file,'doc');
+            } else if(!$cfile && ($fileType == 'xls' || $fileType == 'xlsx')){
                 //	echo $file.'+xls+';
-                $file = Stroage::convertFile($file,'pdf');
+                $cfile = Stroage::convertFile($file,'pdf');
             }
 
             //	echo $file.'++';
-            $num =  Stroage::getPdfFilePage($file);
+            $file = $cfile;
+            $num =  Stroage::getPdfFilePage($cfile);
             // echo $num.'++';
             if($num>0){
                 return $num;