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

Merge branch 'master' of http://16.162.42.175:8014/guanli/ngds

theojeng 3 лет назад
Родитель
Сommit
2e1873b275

+ 21 - 7
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 [
@@ -247,12 +261,12 @@ class OrderList extends \common\libs\dataList\DataList implements DataListInterf
                     },
                 ],
                 'STANDARD_PRICE' => [
-                    'header' => 'Standard Amount', // 商品金额
+                    'header' => 'Total Price($)', // 商品金额
                     'headerOther' => [
                         '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']),

+ 21 - 21
common/models/forms/TransferForm.php

@@ -90,10 +90,10 @@ class TransferForm extends Model {
 
     public function attributeLabels() {
         return [
-            'toUserName' => '转入会员编号',
-            'amount' => '金额',
-            'payPassword' => '支付密码',
-            'transferCode' => '转账校验码',
+            'toUserName' => 'Transferred Member Code', // 转入会员编号
+            'amount' => 'Amount', // 金额
+            'payPassword' => 'Payment Password', // 支付密码
+            'transferCode' => 'Verification Code', // 转账校验码
         ];
     }
 
@@ -106,7 +106,7 @@ class TransferForm extends Model {
     public function initUser($attribute) {
         // 转账记录
         if(!$toUserId = Info::getUserIdByUserName($this->toUserName)){
-            $this->addError($attribute, '转入会员不存在');
+            $this->addError($attribute, 'Transferred member not exists'); // 转入会员不存在
             return null;
         }
 //        if(Info::getUserRealNameByUserId($toUserId)!=$this->toRealName){
@@ -118,7 +118,7 @@ class TransferForm extends Model {
         $fromUserId = \Yii::$app->user->id;
         $fromUser = Info::baseInfo($fromUserId);
         if (!$fromUser) {
-            $this->addError($attribute, '转出会员不存在');
+            $this->addError($attribute, 'Transferred member not exists'); // 转入会员不存在
             return null;
         }
         // 转账条件判断
@@ -173,33 +173,33 @@ class TransferForm extends Model {
      */
     public function isAmount($attribute) {
         if(!$this->_fromUserInfo){
-            $this->addError($attribute, '会员信息未验证通过');
+            $this->addError($attribute, 'Member info has not been verified'); // 会员信息未验证通过
             return null;
         }
         if ($this->amount <= 0) {
-            $this->addError($attribute, '转账金额必须大于0');
+            $this->addError($attribute, 'The transfer amount must be greater than 0'); // 转账金额必须大于0
         }
         if ((int)$this->amount!=$this->amount) {
-            $this->addError('scenario', '转账金额必须是整数');
+            $this->addError('scenario', 'The transfer amount must be a round number'); // 转账金额必须是整数
         }
         $minAmount = $this->_transferConfig['outMin'];
         if ($this->amount < $minAmount) {
-            $this->addError($attribute, '转账金额低于转账下限');
+            $this->addError($attribute, 'The transfer amount is lower than the transfer limit'); // 转账金额低于转账下限
         }
         $maxAmount = $this->_transferConfig['outMax'];
         if ($maxAmount && $this->amount > $maxAmount) {
-            $this->addError($attribute, '转账金额高于转账上限');
+            $this->addError($attribute, 'The transfer amount is higher than the transfer limit'); // 转账金额高于转账上限
         }
         //周转账上限
         if($this->_transferConfig['weekMax']!=0){
             if($this->amount+Transfer::weekTransfer($this->_fromUserInfo['ID'])>$this->_transferConfig['weekMax']){
-                $this->addError($attribute, '超出周转账上限');
+                $this->addError($attribute, 'The working book limit is exceeded'); // 超出周转账上限
             }
         }
         //月转账上限
         if($this->_transferConfig['monthMax']!=0){
             if($this->amount+Transfer::monthTransfer($this->_fromUserInfo['ID'])>$this->_transferConfig['weekMax']){
-                $this->addError($attribute, '超出月转账上限');
+                $this->addError($attribute, 'Exceed the monthly transfer limit'); // 超出月转账上限
             }
         }
 
@@ -210,7 +210,7 @@ class TransferForm extends Model {
             $haveBalance = Balance::getAvailableBalance($this->_fromUserInfo['ID']);
         }
         if ($this->amount > $haveBalance) {
-            $this->addError($attribute, '转账金额必须小于自己的可用余额');
+            $this->addError($attribute, 'The transfer amount must be less than your available balance'); // 转账金额必须小于自己的可用余额
         }
         // 转账比例
         if ($this->type == self::BONUS_TO_BALANCE) {
@@ -218,7 +218,7 @@ class TransferForm extends Model {
             if ($isCanTransferProp == 1) {
                 $maxAmount = Tool::formatPrice($this->_fromUserInfo['TRANSFER_PROP'] * Balance::getAvailableBalance($this->_fromUserInfo['ID']) * 0.01);
                 if ($this->amount > $maxAmount) {
-                    $this->addError($attribute, '转账金额超出转账比例限额');
+                    $this->addError($attribute, 'The transfer amount exceeds the transfer ratio limit'); // 转账金额超出转账比例限额
                 }
             }
         }
@@ -242,14 +242,14 @@ class TransferForm extends Model {
      */
     public function isType($attribute) {
         if (!in_array($this->type, self::allowTransferType)) {
-            $this->addError($attribute, '不允许的转账类型');
+            $this->addError($attribute, 'Types of transfers that are not allowed'); // 不允许的转账类型
         }
         //获取转账参数
         if(!$this->_transferConfig = Json::decode(Cache::getSystemConfig()['allowWallet']['VALUE'])[$this->type-1]){
-            $this->addError($attribute, '错误的转账类型');
+            $this->addError($attribute, 'Wrong type of transfer'); // 错误的转账类型
         }
         if(!$this->_transferConfig['isOpen']){
-            $this->addError($attribute, '不可用的转账类型');
+            $this->addError($attribute, 'Type of transfer that is not available'); // 不可用的转账类型
         }
     }
 
@@ -260,7 +260,7 @@ class TransferForm extends Model {
      */
     public function validatePassword($attribute, $params) {
         if (!User::validatePayPassword($this->_fromUserInfo['ID'], $this->payPassword)) {
-            $this->addError($attribute, '支付密码不正确');
+            $this->addError($attribute, 'The payment password is incorrect');//支付密码不正确
         }
     }
 
@@ -269,7 +269,7 @@ class TransferForm extends Model {
         $redisCode = \Yii::$app->redis->getset('transferCode_'.$uid,'');
         \Yii::$app->redis->del('transferCode_'.$uid);
         if ($this->transferCode!=$redisCode) {
-            $this->addError($attribute, '转账校验失败'.$redisCode);
+            $this->addError($attribute, 'Transfer verification failed '.$redisCode); // 转账校验失败
         }
     }
     /**
@@ -350,7 +350,7 @@ class TransferForm extends Model {
                 Cash::changeUserCash($this->_fromUserInfo['ID'], 'CASH', -abs($this->amount), ['TRANSFER_SN' => $model->TRANSFER_SN,'DEAL_TYPE_ID' => DealType::TRANSFER_OUT, 'REMARK' => 'To:' . $this->_toUserInfo['USER_NAME'] . ',' . $this->remark]);
                 Cash::changeUserCash($this->_toUserInfo['ID'], 'CASH', abs($amount), ['TRANSFER_SN' => $model->TRANSFER_SN,'DEAL_TYPE_ID' => DealType::TRANSFER_IN, 'REMARK' => 'From:' . $this->_fromUserInfo['USER_NAME'] . ',' . $this->remark]);
             }else {
-                throw new \Exception('错误的交易类型');
+                throw new \Exception('Wrong transaction type'); // 错误的交易类型
             }
 
             $transaction->commit();