kevin_zhangl 3 лет назад
Родитель
Сommit
ff784fc1a4

+ 20 - 6
backendApi/modules/v1/models/lists/shop/OrderList.php

@@ -123,10 +123,6 @@ class OrderList extends \common\libs\dataList\DataList implements DataListInterf
                     'header' => 'Product Name', // 存货名称
                     'headerOther' => ['width' => '200'],
                 ],
-                'BUY_NUMS' => [
-                    'header' => 'Qty', // 数量
-                    'headerOther' => ['width' => '100'],
-                ],
                 'CONSIGNEE' => [
                     'header' => 'Recipient', // 收货人
                     'headerOther' => [
@@ -218,6 +214,10 @@ class OrderList extends \common\libs\dataList\DataList implements DataListInterf
                     },
                     'headerOther' => ['width' => '190'],
                 ],
+                'BUY_NUMS' => [
+                    'header' => 'Qty', // 数量
+                    'headerOther' => ['width' => '100'],
+                ],
                 'REAL_PRICE' => [
                     'header' => 'Item Pricing', // 商品单价
                     'headerOther' => [
@@ -232,13 +232,27 @@ class OrderList extends \common\libs\dataList\DataList implements DataListInterf
                         ];
                     },
                 ],
+                'TOTAL_PRICE' => [
+                    'header' => 'Total Price', // 订单总价
+                    'headerOther' => [
+                        'width' => '150',
+                    ],
+                    'value' => function ($row) {
+                        return Tool::formatPrice($row['REAL_PRICE'] * $row['BUY_NUMS']);
+                    },
+                    'valueOther' => function ($row) {
+                        return [
+                            'tag' => ['type' => 'danger', 'size' => 'small', 'class' => 'no-border']
+                        ];
+                    },
+                ],
                 'REAL_PV' => [
                     'header' => 'BV Amount', // 商品金额
                     'headerOther' => [
                         'width' => '150',
                     ],
                     'value' => function ($row) {
-                        return Tool::formatPrice($row['REAL_PV']);
+                        return Tool::formatPrice($row['REAL_PV'] * $row['BUY_NUMS']);
                     },
                     'valueOther' => function ($row) {
                         return [
@@ -252,7 +266,7 @@ class OrderList extends \common\libs\dataList\DataList implements DataListInterf
                         'width' => '150',
                     ],
                     'value' => function ($row) {
-                        return Tool::formatPrice($row['ORDER_AMOUNT_STANDARD']);
+                        return Tool::formatPrice($row['STANDARD_PRICE'] * $row['BUY_NUMS']);
                     },
                     'valueOther' => function ($row) {
                         return [

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

@@ -341,7 +341,6 @@ class BaseExport extends Component {
                     'STATUS' => \Yii::$app->params['orderStatus'][$columnData['STATUS']]['label'] ?? '',
                     'SKU_CODE' => $columnData['SKU_CODE'],
                     'GOODS_TITLE' => Tool::mbSignConvert($columnData['GOODS_TITLE']) ,
-                    'BUY_NUMS' => $columnData['BUY_NUMS'],
                     'CONSIGNEE' => $columnData['CONSIGNEE'],
                     'MOBILE' => "\t{$columnData['MOBILE']}",
                     'TEL' => "\t{$columnData['TEL']}",
@@ -356,9 +355,11 @@ class BaseExport extends Component {
                     'PAY_TYPE' => ShopGoods::payTypes()[$columnData['PAY_TYPE']]['name'] ?? ShopGoods::payTypes()['cash']['name'],
                     'PAY_AT' => $columnData['PAY_AT'] > 0 ? Date('Y-m-d H:i:s', $columnData['PAY_AT']) : '',
                     'DELIVERY_AT' => $columnData['DELIVERY_AT'] > 0 ? Date('Y-m-d H:i:s', $columnData['DELIVERY_AT']) : '',
+                    'BUY_NUMS' => $columnData['BUY_NUMS'],
                     'REAL_PRICE' => $columnData['REAL_PRICE'],
-                    'REAL_PV' => $columnData['REAL_PV'],
-                    'STANDARD_PRICE' => $columnData['ORDER_AMOUNT_STANDARD'],
+                    'TOTAL_PRICE' => $columnData['REAL_PRICE'] * $columnData['BUY_NUMS'],
+                    'REAL_PV' => $columnData['REAL_PV'] * $columnData['BUY_NUMS'],
+                    'STANDARD_PRICE' => $columnData['STANDARD_PRICE'] * $columnData['BUY_NUMS'],
                     'PAY_FREIGHT' => $columnData['PAY_FREIGHT'],
                     'TAX_RATE' => $columnData['TAX_RATE'],
                     'TAX_AMOUNT' => Tool::calculateTax($columnData['REAL_PRICE'], $columnData['TAX_RATE'], $columnData['BUY_NUMS']),