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

feat: EK-3320: 订单增加 Invoice 下载

zhangl 2 месяцев назад
Родитель
Сommit
18e999f6b0
1 измененных файлов с 49 добавлено и 3 удалено
  1. 49 3
      common/libs/export/BaseExport.php

+ 49 - 3
common/libs/export/BaseExport.php

@@ -1636,6 +1636,52 @@ EOT;
 
             // 订单基本信息
             $orderBase = <<<ORDER
+                <table border="1" style="table-layout: fixed; padding: 10px 20px;" width="100%">
+                    <tr>
+                        <td width="50%" style="font-weight: bold; text-align: center; font-size: 14px;">
+                            <td width="50%" style="font-weight: bold; text-align: center; font-size: 14px;">
+                                Bill to
+                            </td>
+                            <td width="50%">
+                                Invoce No.: 123213123123
+                            </td>
+                        </td>
+                    </tr>
+                    <tr>
+                        <td width="50%" style="font-weight: bold; text-align: center; font-size: 14px;">
+                            <td width="50%" style="font-weight: bold; text-align: center; font-size: 14px;">
+                                Name of Distributor: {$userName}
+                            </td>
+                            <td width="50%">
+                                Date: {$orderAt}
+                            </td>
+                        </td>
+                    </tr>
+                    <tr>
+                        <td width="50%" style="font-weight: bold; text-align: center; font-size: 14px;">
+                            <td width="50%" style="font-weight: bold; text-align: center; font-size: 14px;">
+                                Member ID: {$userId}
+                            </td>
+                            <td width="50%">
+                                Payment status: {$paymentStatus}
+                            </td>
+                        </td>
+                    </tr>
+                    <tr>
+                        <td width="50%" style="font-weight: bold; text-align: center; font-size: 14px;">
+                            <td width="100%" style="font-weight: bold; text-align: center; font-size: 14px;">
+                                Address: {$address}
+                            </td>
+                        </td>
+                    </tr>
+                    <tr>
+                        <td width="50%" style="font-weight: bold; text-align: center; font-size: 14px;">
+                            <td width="100%" style="font-weight: bold; text-align: center; font-size: 14px;">
+                                Contact: {$mobile}
+                            </td>
+                        </td>
+                    </tr>
+                </table>
 ORDER;
 
             $l['a_meta_charset'] = 'UTF-8';
@@ -1750,9 +1796,9 @@ ORDER;
             $pdf->AddPage();
             // 设置字体
             $pdf->SetFont('stsongstdlight', '', 10, '', true);
-            $image_file = \Yii::$app->basePath . '/../ngds-logo.jpg';
-            $image = file_get_contents($image_file);
-            $pdf->Image('@' . $image, 15, 12, 20, 7, 'JPG');
+//            $image_file = \Yii::$app->basePath . '/../ngds-logo.jpg';
+//            $image = file_get_contents($image_file);
+//            $pdf->Image('@' . $image, 15, 12, 20, 7, 'JPG');
             $pdf->writeHTML($context);
 
             $result = $pdf->Output($realFile, 'F');