Просмотр исходного кода

bugfix: EK-0524: 结算后台无法下载PDF订单.

kevinElken 9 месяцев назад
Родитель
Сommit
048b31c772
1 измененных файлов с 6 добавлено и 9 удалено
  1. 6 9
      frontendApi/modules/v1/controllers/ShopController.php

+ 6 - 9
frontendApi/modules/v1/controllers/ShopController.php

@@ -1059,9 +1059,8 @@ ORDER;
 
         $file_name = $orderSn . '.pdf';
         $path = 'pdfs/' . $file_name;
-        $pdf = $pdf->Output(Yii::$app->basePath . '/web/' . $path, 'F');
-        LoggerTool::debug(['pdf', $pdf]);
-        exec('chmod -R 777 /' . Yii::$app->basePath . '/web' . $path);
+        $pdf->Output(Yii::$app->basePath . '/web/' . $path, 'F');
+        @exec('chmod -R 777 /' . Yii::$app->basePath . '/web' . $path);
 
         return static::notice(['fileUrl' => $path, 'targetName' => $file_name]);
     }
@@ -1328,9 +1327,8 @@ ORDER;
 
         $file_name = $orderSn . '.pdf';
         $path = 'pdfs/' . $file_name;
-        $pdf = $pdf->Output(Yii::$app->basePath . '/web/' . $path, 'F');
-        LoggerTool::debug(['pdf', $pdf]);
-        exec('chmod -R 777 /' . Yii::$app->basePath . '/web' . $path);
+        $pdf->Output(Yii::$app->basePath . '/web/' . $path, 'F');
+        @exec('chmod -R 777 /' . Yii::$app->basePath . '/web' . $path);
 
         return static::notice(['fileUrl' => $path, 'targetName' => $file_name]);
     }
@@ -1905,9 +1903,8 @@ ORDER;
 
         $file_name = $orderSn . '.pdf';
         $path = 'pdfs/' . $file_name;
-        $pdf = $pdf->Output(Yii::$app->basePath . '/web/' . $path, 'F');
-        LoggerTool::debug(['pdf', $pdf]);
-        exec('chmod -R 777 /' . Yii::$app->basePath . '/web' . $path);
+        $pdf->Output(Yii::$app->basePath . '/web/' . $path, 'F');
+        @exec('chmod -R 777 /' . Yii::$app->basePath . '/web' . $path);
 
         return static::notice(['fileUrl' => $path, 'targetName' => $file_name]);
     }