Przeglądaj źródła

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

kevinElken 7 miesięcy temu
rodzic
commit
a3918fa091

+ 15 - 12
common/libs/export/BaseExport.php

@@ -830,10 +830,11 @@ ORDER;
             $pdf->AddPage();
             $pdf->AddPage();
             // 设置字体
             // 设置字体
             $pdf->SetFont('stsongstdlight', '', 10, '', true);
             $pdf->SetFont('stsongstdlight', '', 10, '', true);
-            $image_file = \Yii::$app->basePath . '/../frontendEle/src/static/img/ngds-logo.jpg';
-            if (!file_exists($image_file)) {
-                $image_file = \Yii::$app->runtimePath . '/uploads/ngds-logo.jpg';
-            }
+            //        $image_file = \Yii::$app->basePath . '/../frontendEle/src/static/img/ngds-logo.jpg';
+//        if (!file_exists($image_file)) {
+//            $image_file = \Yii::$app->runtimePath . '/../common/uploads/ngds-logo.jpg';
+//        }
+            $image_file = \Yii::$app->runtimePath . '/../ngds-logo.jpg';
             $image = file_get_contents($image_file);
             $image = file_get_contents($image_file);
 
 
             $pdf->Image('@' . $image, 15, 12, 20, 7, 'JPG');
             $pdf->Image('@' . $image, 15, 12, 20, 7, 'JPG');
@@ -1109,10 +1110,11 @@ ORDER;
             // 设置字体
             // 设置字体
             $pdf->SetFont('stsongstdlight', '', 10, '', true);
             $pdf->SetFont('stsongstdlight', '', 10, '', true);
             $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
             $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
-            $image_file = \Yii::$app->basePath . '/../frontendEle/src/static/img/ngds-logo.jpg';
-            if (!file_exists($image_file)) {
-                $image_file = \Yii::$app->runtimePath . '/uploads/ngds-logo.jpg';
-            }
+            //        $image_file = \Yii::$app->basePath . '/../frontendEle/src/static/img/ngds-logo.jpg';
+//        if (!file_exists($image_file)) {
+//            $image_file = \Yii::$app->runtimePath . '/../common/uploads/ngds-logo.jpg';
+//        }
+            $image_file = \Yii::$app->runtimePath . '/../ngds-logo.jpg';
             $image = file_get_contents($image_file);
             $image = file_get_contents($image_file);
             $pdf->Image('@' . $image, 165, 5, 20, 10, 'JPG');
             $pdf->Image('@' . $image, 165, 5, 20, 10, 'JPG');
             $pdf->writeHTML($context);
             $pdf->writeHTML($context);
@@ -1509,10 +1511,11 @@ ORDER;
             $pdf->AddPage();
             $pdf->AddPage();
             // 设置字体
             // 设置字体
             $pdf->SetFont('stsongstdlight', '', 10, '', true);
             $pdf->SetFont('stsongstdlight', '', 10, '', true);
-            $image_file = \Yii::$app->basePath . '/../frontendEle/src/static/img/ngds-logo.jpg';
-            if (!file_exists($image_file)) {
-                $image_file = \Yii::$app->runtimePath . '/uploads/ngds-logo.jpg';
-            }
+            //        $image_file = \Yii::$app->basePath . '/../frontendEle/src/static/img/ngds-logo.jpg';
+//        if (!file_exists($image_file)) {
+//            $image_file = \Yii::$app->runtimePath . '/../common/uploads/ngds-logo.jpg';
+//        }
+            $image_file = \Yii::$app->runtimePath . '/../ngds-logo.jpg';
             $image = file_get_contents($image_file);
             $image = file_get_contents($image_file);
             $pdf->Image('@' . $image, 15, 12, 20, 7, 'JPG');
             $pdf->Image('@' . $image, 15, 12, 20, 7, 'JPG');
             $pdf->writeHTML($context);
             $pdf->writeHTML($context);

+ 15 - 12
frontendApi/modules/v1/controllers/ShopController.php

@@ -1046,10 +1046,11 @@ ORDER;
         $pdf->AddPage();
         $pdf->AddPage();
         // 设置字体
         // 设置字体
         $pdf->SetFont('stsongstdlight', '', 10, '', true);
         $pdf->SetFont('stsongstdlight', '', 10, '', true);
-        $image_file = \Yii::$app->basePath . '/../frontendEle/src/static/img/ngds-logo.jpg';
-        if (!file_exists($image_file)) {
-            $image_file = \Yii::$app->runtimePath . '/uploads/ngds-logo.jpg';
-        }
+        //        $image_file = \Yii::$app->basePath . '/../frontendEle/src/static/img/ngds-logo.jpg';
+//        if (!file_exists($image_file)) {
+//            $image_file = \Yii::$app->runtimePath . '/../common/uploads/ngds-logo.jpg';
+//        }
+        $image_file = \Yii::$app->runtimePath . '/../ngds-logo.jpg';
         $image = file_get_contents($image_file);
         $image = file_get_contents($image_file);
         $pdf->Image('@' . $image, 15, 12, 20, 7, 'JPG');
         $pdf->Image('@' . $image, 15, 12, 20, 7, 'JPG');
         $pdf->writeHTML($context);
         $pdf->writeHTML($context);
@@ -1314,10 +1315,11 @@ ORDER;
         $pdf->AddPage();
         $pdf->AddPage();
         // 设置字体
         // 设置字体
         $pdf->SetFont('stsongstdlight', '', 10, '', true);
         $pdf->SetFont('stsongstdlight', '', 10, '', true);
-        $image_file = \Yii::$app->basePath . '/../frontendEle/src/static/img/ngds-logo.jpg';
-        if (!file_exists($image_file)) {
-            $image_file = \Yii::$app->runtimePath . '/uploads/ngds-logo.jpg';
-        }
+        //        $image_file = \Yii::$app->basePath . '/../frontendEle/src/static/img/ngds-logo.jpg';
+//        if (!file_exists($image_file)) {
+//            $image_file = \Yii::$app->runtimePath . '/../common/uploads/ngds-logo.jpg';
+//        }
+        $image_file = \Yii::$app->runtimePath . '/../ngds-logo.jpg';
         $image = file_get_contents($image_file);
         $image = file_get_contents($image_file);
         $pdf->Image('@' . $image, 15, 12, 20, 7, 'JPG');
         $pdf->Image('@' . $image, 15, 12, 20, 7, 'JPG');
         $pdf->writeHTML($context);
         $pdf->writeHTML($context);
@@ -1888,10 +1890,11 @@ ORDER;
         $pdf->AddPage();
         $pdf->AddPage();
         // 设置字体
         // 设置字体
         $pdf->SetFont('stsongstdlight', '', 10, '', true);
         $pdf->SetFont('stsongstdlight', '', 10, '', true);
-        $image_file = \Yii::$app->basePath . '/../frontendEle/src/static/img/ngds-logo.jpg';
-        if (!file_exists($image_file)) {
-            $image_file = \Yii::$app->runtimePath . '/uploads/ngds-logo.jpg';
-        }
+//        $image_file = \Yii::$app->basePath . '/../frontendEle/src/static/img/ngds-logo.jpg';
+//        if (!file_exists($image_file)) {
+//            $image_file = \Yii::$app->runtimePath . '/../common/uploads/ngds-logo.jpg';
+//        }
+        $image_file = \Yii::$app->runtimePath . '/../ngds-logo.jpg';
         $image = file_get_contents($image_file);
         $image = file_get_contents($image_file);
 
 
         $pdf->Image('@' . $image, 15, 12, 20, 7, 'JPG');
         $pdf->Image('@' . $image, 15, 12, 20, 7, 'JPG');

BIN
ngds-logo.jpg