Răsfoiți Sursa

更新word模板

sandm 3 ani în urmă
părinte
comite
60a61e3b59
1 a modificat fișierele cu 4 adăugiri și 1 ștergeri
  1. 4 1
      app/Jobs/TicketJob.php

+ 4 - 1
app/Jobs/TicketJob.php

@@ -257,7 +257,10 @@ class TicketJob implements ShouldQueue
         $templateProcessor = new TemplateProcessor(base_path() . $template);
         foreach ($data as $k => $v){
             if($k == 'avatar'){
-                $templateProcessor->setImageValue('avatar',['path' => base_path() . '/public/' . $v, 'width' => 200, 'height' => 150]);
+                if(file_exists(base_path() . '/public/' . $v)){
+                    $templateProcessor->setImageValue('avatar',['path' => base_path() . '/public/' . $v, 'width' => 200, 'height' => 150]);
+                }
+
             }else{
                 $templateProcessor->setValue($k, $v);
             }