Преглед изворни кода

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

zhangl пре 1 месец
родитељ
комит
a425345eff
1 измењених фајлова са 40 додато и 47 уклоњено
  1. 40 47
      common/libs/export/BaseExport.php

+ 40 - 47
common/libs/export/BaseExport.php

@@ -1582,10 +1582,11 @@ ORDER;
             $invoiceRemark = '';
             $paymentMethod = ''; // 支付方式
             $currency = '';
+            $invoiceNo = '';
 
             foreach ($oderList as $key => $value) {
                 $no = $key + 1;
-                $invoiceRemark = $value['INVOICE_REMARK'] ? $value['INVOICE_REMARK'] : '';
+                $invoiceRemark = $value['INVOICE_REMARK'] ?: '';
                 $provinceName = $value['PROVINCE'] ? Region::getCnName($value['PROVINCE']) : '';
                 $cityName = $value['CITY'] ? Region::getCnName($value['CITY']) : '';
                 $countyName = $value['COUNTY'] ? Region::getCnName($value['COUNTY']) : '';
@@ -1610,6 +1611,7 @@ ORDER;
                 $taxAbleAmount = Tool::formatAmount($totalAmount - $taxAmount);
                 $taxAmount = Tool::formatAmount($taxAmount);
                 $totalAmount = Tool::formatAmount($totalAmount);
+                $invoiceNo = '123213123123';
 
                 // 订单详情
                 $orderDetails .= <<<EOT
@@ -1647,46 +1649,6 @@ EOT;
             $date = Yii::t('app', 'date');
             $createAt = Yii::t('app', 'createAt');
 
-            // 订单基本信息
-            $orderBase = <<<ORDER
-                <table style="table-layout: fixed;" class="table-noborder">
-                    <tr>
-                        <td style="text-align: left; font-size: 14px; width:50%;">
-                            Bill to
-                        </td>
-                        <td style="text-align: left; font-size: 14px; width:50%;">
-                            Invoice No.: 123213123123
-                        </td>
-                    </tr>
-                    <tr>
-                        <td style="text-align: left; font-size: 14px; width:50%;">
-                            Name of Distributor: {$userName}
-                        </td>
-                        <td style="text-align: left; font-size: 14px; width:50%;">
-                            Date: {$orderAt}
-                        </td>
-                    </tr>
-                    <tr>
-                        <td style="text-align: left; font-size: 14px; width:50%;">
-                            Member ID: {$userId}
-                        </td>
-                        <td style="text-align: left; font-size: 14px; width:50%;">
-                            Payment status: {$paymentStatus}
-                        </td>
-                    </tr>
-                    <tr>
-                        <td style="text-align: left; font-size: 14px;" colspan="2">
-                            Address: {$address}
-                        </td>
-                    </tr>
-                    <tr>
-                        <td style="text-align: left; font-size: 14px;" colspan="2">
-                            Contact: {$mobile}
-                        </td>
-                    </tr>
-                </table>
-ORDER;
-
             $l['a_meta_charset'] = 'UTF-8';
             $l['a_meta_dir'] = 'ltr';
             $l['a_meta_language'] = 'zh';
@@ -1707,12 +1669,8 @@ ORDER;
                     }
                     table td, table th {
                         border: 1px solid #ccc;
-                        /*padding: 5px 5px;*/
                         border-collapse: collapse;
                     }
-                    /*td {*/
-                    /*    padding: 120px;*/
-                    /*}*/
                     .bg {
                         background-color: #ccc;
                     }
@@ -1743,12 +1701,47 @@ ORDER;
                     <hr /><br><br>
                     <div>
                         <div style="display: block; width: 100%;">
-                            {$orderBase}
+                            <table style="table-layout: fixed;" class="table-noborder">
+                                <tr>
+                                    <td style="text-align: left; font-size: 14px; width:50%;">
+                                        Bill to
+                                    </td>
+                                    <td style="text-align: left; font-size: 14px; width:50%;">
+                                        Invoice No.: {$invoiceNo}
+                                    </td>
+                                </tr>
+                                <tr>
+                                    <td style="text-align: left; font-size: 14px; width:50%;">
+                                        Name of Distributor: {$userName}
+                                    </td>
+                                    <td style="text-align: left; font-size: 14px; width:50%;">
+                                        Date: {$orderAt}
+                                    </td>
+                                </tr>
+                                <tr>
+                                    <td style="text-align: left; font-size: 14px; width:50%;">
+                                        Member ID: {$userId}
+                                    </td>
+                                    <td style="text-align: left; font-size: 14px; width:50%;">
+                                        Payment status: {$paymentStatus}
+                                    </td>
+                                </tr>
+                                <tr>
+                                    <td style="text-align: left; font-size: 14px;" colspan="2">
+                                        Address: {$address}
+                                    </td>
+                                </tr>
+                                <tr>
+                                    <td style="text-align: left; font-size: 14px;" colspan="2">
+                                        Contact: {$mobile}
+                                    </td>
+                                </tr>
+                            </table>
                             
                             <br />
                             <br />
                             <br />
-                            <table border="1" width="100%" style="text-align: left; line-height: 5px;">
+                            <table border="1" width="100%" style="text-align: left; line-height: 5px; padding: 5px 2px;">
                                 <tr>
                                     <th style="font-size: 14px; font-weight: bold; text-align: center;">No.</th>
                                     <th style="font-size: 14px; font-weight: bold; text-align: center;">Product Code</th>