root 2 лет назад
Родитель
Сommit
b181e29d68

+ 3 - 3
backendApi/modules/v1/controllers/FinanceController.php

@@ -125,7 +125,7 @@ class FinanceController extends BaseController {
             'AUDIT_ADMIN_NAME' => 'ADMU.ADMIN_NAME',
         ]);
         $form = new FinanceExportForm();
-        $result = $form->run($filter, 'Member_Ecoin_adjustment_list'); // 会员余额调整列表
+        $result = $form->run($filter, Yii::t('ctx', 'memberEcoinAdjustmentListFileName')); // 会员余额调整列表
         if (!$result) {
             return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
         }
@@ -139,7 +139,7 @@ class FinanceController extends BaseController {
      */
     public function actionChangeBalance() {
         if (Yii::$app->request->isPost) { // 申请变动会员余额成功
-            return static::edit(ChangeBalanceForm::class, 'Application for change of member balance succeeded', 'changeAdd', ['changeAdd'], null, function ($formModel, $result) {
+            return static::edit(ChangeBalanceForm::class, Yii::t('ctx', 'applicationChangeBalanceSucceeded'), 'changeAdd', ['changeAdd'], null, function ($formModel, $result) {
                 // $userInfo = User::getBaseInfoFromRedis($result['USER_ID']);
                 // $type = BalanceAudit::TYPE[$result['TYPE']]['label'];
                 // Log::adminHandle('申请调整会员' . $userInfo['USER_NAME'] . '的' . $type . '余额,金额:' . $result['AMOUNT'], 1, $userInfo['ID'], $userInfo['USER_NAME'], $result['CREATE_REMARK']);
@@ -168,7 +168,7 @@ class FinanceController extends BaseController {
         $id = Yii::$app->request->get('id');
         $balanceAudit = BalanceAudit::findOneAsArray('ID=:ID', [':ID' => $id]);
         if (!$balanceAudit) {
-            return static::notice('Data not exists', 400);
+            return static::notice(Yii::t('ctx', 'dataNotExists'), 400);
         }
         $balanceAudit['BASE_INFO'] = Info::baseInfoWithBalance($balanceAudit['USER_ID']);
         return static::notice(['id' => $balanceAudit['ID'], 'baseInfo' => $balanceAudit['BASE_INFO'], 'type' => $balanceAudit['TYPE'], 'dealType' => $balanceAudit['DEAL_TYPE'], 'amount' => Tool::formatPrice($balanceAudit['AMOUNT']), 'remark' => $balanceAudit['CREATE_REMARK'], 'isShow' => $balanceAudit['REMARK_IS_SHOW']]);

+ 20 - 1
common/messages/en-US/ctx.php

@@ -1,6 +1,25 @@
 <?php
 return [
+    #Finance
+    'memberEcoinAdjustmentListFileName'=> 'Member_Ecoin_adjustment_list',
+    'applicationChangeBalanceSucceeded'=> 'Application for change of member balance succeeded',
+    'applicationCannotReviewedAgain'=> 'The application has been reviewed and cannot be reviewed again',
+    'idNotMatchName'=>'Member ID does not match member name',
+    'incorrectBalanceType'=>'Incorrect balance type',
+    'incorrectTransactionType'=>'Incorrect transaction type',
+    'adjustmentAmountCannotZero'=>'The adjustment amount cannot be 0',
+    'pointsEnoughAdjustmentNotAllowed' => 'Insufficient balance of member cancellation points, adjustment not allowed',
+    'cannotSetPendingReview' => 'Cannot be set to pending review',
+    'auditCannotRepeated' => 'The audit has been approved and cannot be repeated',
+    'rejectedAuditCannotRepeated'=> 'It has been reviewed and rejected and cannot be reviewed again',
+    'statusParameterError' => 'Status parameter error',
+    'adjustmentBalanceCodeFailed' => 'Balance adjustment review verification code failed',
+    'aPieceMustBeSelected' => 'A piece of data must be selected',
+    'noEligibleData' => 'No eligible data',
+
     # 公用
+    'memberDoesNotExist' => 'Member does not exist',
+    'dataNotExists' => 'Data not exists',
     'startExporting'=> 'Starting exporting, please go to File Management - Export Files to view.',
     'incorrectDateFormat' => 'Incorrect date format',
     'notConnection' => 'Connection not operated for too long',
@@ -204,7 +223,7 @@ return [
     'failedToGenerateMemberNumber' => 'Failed to generate member number',
     'memberNumberDoesNotExist' => 'Member number does not exist',
     'repeatSalesMemberNoDoesNotExist' => 'Repeat sales Member No. does not exist',
-    'memberDoesNotExist' => 'Member does not exist',
+    
     'memberDoesNotInSamePlacementNetwork' => 'The member is not in the same placement network as the current user',
     'viewSubMembersMost' => 'View the top 20 sub members of the member at most',
     'upgradeMethodIncorrect' => 'The upgrade method is incorrect. Please contact the customer service personnel',

+ 20 - 1
common/messages/zh-CN/ctx.php

@@ -1,6 +1,25 @@
 <?php
 return [
+    #Finance
+    'memberEcoinAdjustmentListFileName'=> '会员余额调整列表',
+    'applicationChangeBalanceSucceeded'=> '申请变动会员余额成功',
+    'applicationCannotReviewedAgain'=> '该申请已经被审核,不能重复审核',
+    'idNotMatchName'=>'会员编号与会员姓名不匹配',
+    'incorrectBalanceType'=>'余额类型不正确',
+    'incorrectTransactionType'=>'交易类型不正确',
+    'adjustmentAmountCannotZero'=>'调整金额不能为0',
+    'pointsEnoughAdjustmentNotAllowed' => '会员复消积分余额不足,不允许调整',
+    'cannotSetPendingReview' => '不能设置为待审核状态',
+    'auditCannotRepeated' => '已经审核通过不能重复审核',
+    'rejectedAuditCannotRepeated'=> '已经审核拒绝不能重复审核',
+    'statusParameterError' => '状态参数有误',
+    'adjustmentBalanceCodeFailed' => '余额调整审核校验码失败',
+    'aPieceMustBeSelected' => '必须选择一条数据',
+    'noEligibleData' => '没有符合条件的数据',
+
     # 公用
+    'memberDoesNotExist' => '会员不存在',
+    'dataNotExists' => '数据不存在',
     'startExporting'=> '导出开始,请到文件管理-导出文件查看',
     'incorrectDateFormat' => '日期筛选格式不对',
     'notConnection' => '长时间未操作',
@@ -209,7 +228,7 @@ return [
     'failedToGenerateMemberNumber' => '会员编号生成失败',
     'memberNumberDoesNotExist' => '会员编号不存在',
     'repeatSalesMemberNoDoesNotExist' => '复消会员编号不存在',
-    'memberDoesNotExist' => '会员不存在',
+    
     'memberDoesNotInSamePlacementNetwork' => '会员与当前用户不再同一安置网络内',
     'viewSubMembersMost' => '最多查看会员的前20层子会员',
     'upgradeMethodIncorrect' => '升级方式不正确,请联系客服人员',

+ 16 - 16
common/models/forms/ChangeBalanceForm.php

@@ -109,7 +109,7 @@ class ChangeBalanceForm extends Model {
         $model = $this->_model = BalanceAudit::findOne(['ID' => $this->id]);
         $this->_userId = $model['USER_ID'];
         if ($model->AUDIT_STATUS > \Yii::$app->params['auditStatus']['un']['value']) {
-            $this->addError($attribute, 'The application has been reviewed and cannot be reviewed again');// 该申请已经被审核,不能重复审核
+            $this->addError($attribute, \Yii::t('ctx', 'applicationCannotReviewedAgain'));// 该申请已经被审核,不能重复审核
         }
     }
 
@@ -124,11 +124,11 @@ class ChangeBalanceForm extends Model {
             if ($this->scenario == 'excelChangeBalance') {
                 $realName = Info::getUserRealNameByUserId($this->_userId);
                 if ($realName != $this->realName) {
-                    $this->addError($attribute, '会员编号与会员姓名不匹配');
+                    $this->addError($attribute, \Yii::t('ctx', 'idNotMatchName'));
                 }
             }
         } else {
-            $this->addError($attribute, 'Member does not exist'); // 会员不存在
+            $this->addError($attribute, \Yii::t('ctx', 'memberDoesNotExist')); // 会员不存在
         }
     }
 
@@ -138,7 +138,7 @@ class ChangeBalanceForm extends Model {
      */
     public function isType($attribute) {
         if (!key_exists($this->type, BalanceAudit::TYPE)) {
-            $this->addError($attribute, '余额类型不正确');
+            $this->addError($attribute, \Yii::t('ctx', 'incorrectBalanceType'));
         }
         // 查看表里面是否有想同类型的未审核单,如果有的话,不允许再申请,需等审核完成以后,才能申请
         /*if(BalanceAudit::find()->where('USER_ID=:USER_ID AND TYPE=:TYPE AND STATUS=:STATUS', [':USER_ID'=>$this->_userId, ':TYPE'=>$this->type, ':STATUS'=>BalanceAudit::STATUS_APPLIED])->exists()){
@@ -153,7 +153,7 @@ class ChangeBalanceForm extends Model {
      */
     public function isDealType($attribute) {
         if (!key_exists($this->dealType, DealType::getTypes())) {
-            $this->addError($attribute, '交易类型不正确');
+            $this->addError($attribute, \Yii::t('ctx', 'incorrectTransactionType'));
         }
     }
 
@@ -162,9 +162,9 @@ class ChangeBalanceForm extends Model {
      * @param $attribute
      */
     public function isAmount($attribute) {
-        if ($this->amount == 0) $this->addError($attribute, '调整金额不能为0');
+        if ($this->amount == 0) $this->addError($attribute, \Yii::t('ctx', 'adjustmentAmountCannotZero'));
         if ($this->amount < 0 && $this->type == 'reconsume_points' && abs($this->amount) > Balance::getBalanceReconsumePoints($this->_userId)) {
-            $this->addError('scenario', '会员复消积分余额不足,不允许调整');
+            $this->addError('scenario', \Yii::t('ctx', 'pointsEnoughAdjustmentNotAllowed'));
         }
 //        if ($this->amount < 0 && $this->type == 'lx' && abs($this->amount) > Balance::getBalanceLX($this->_userId)) {
 //            $this->addError('scenario', '会员领袖分红余额不足,不允许调整');
@@ -185,24 +185,24 @@ class ChangeBalanceForm extends Model {
         }
         switch ($this->auditStatus) {
             case 'un':
-                $this->addError($attribute, 'Cannot be set to pending review' . $this->auditStatus); // 不能设置为待审核状态
+                $this->addError($attribute, \Yii::t('ctx', 'cannotSetPendingReview') . $this->auditStatus); // 不能设置为待审核状态
                 break;
             case 'true':
                 if (isset($oneData['AUDIT_STATUS']) && $oneData['AUDIT_STATUS'] == \Yii::$app->params['auditStatus']['true']['value']) {
-                    $this->addError($attribute, 'The audit has been approved and cannot be repeated'); // 已经审核通过不能重复审核
+                    $this->addError($attribute, \Yii::t('ctx', 'auditCannotRepeated')); // 已经审核通过不能重复审核
                 } elseif (isset($oneData['AUDIT_STATUS']) && $oneData['AUDIT_STATUS'] == \Yii::$app->params['auditStatus']['reject']['value']) {
-                    $this->addError($attribute, 'It has been reviewed and rejected and cannot be reviewed again'); // 已经审核拒绝不能重复审核
+                    $this->addError($attribute, \Yii::t('ctx', 'rejectedAuditCannotRepeated')); // 已经审核拒绝不能重复审核
                 }
                 break;
             case 'reject':
                 if ($oneData['AUDIT_STATUS'] == \Yii::$app->params['auditStatus']['true']['value']) {
-                    $this->addError($attribute, 'The audit has been approved and cannot be repeated'); // 已经审核通过不能重复审核
+                    $this->addError($attribute, \Yii::t('ctx', 'auditCannotRepeated')); // 已经审核通过不能重复审核
                 } elseif ($oneData['AUDIT_STATUS'] == \Yii::$app->params['auditStatus']['reject']['value']) {
-                    $this->addError($attribute, 'It has been reviewed and rejected and cannot be reviewed again'); // 已经审核拒绝不能重复审核
+                    $this->addError($attribute, \Yii::t('ctx', 'rejectedAuditCannotRepeated')); // 已经审核拒绝不能重复审核
                 }
                 break;
             default:
-                $this->addError($attribute, '状态参数有误');
+                $this->addError($attribute, \Yii::t('ctx', 'statusParameterError'));
         }
     }
 
@@ -210,7 +210,7 @@ class ChangeBalanceForm extends Model {
         $adminId = \Yii::$app->user->id;
         $redisCode = \Yii::$app->redis->getset('balanceCode_'.$adminId,'');
         if ($this->balanceCode!=$redisCode) {
-            $this->addError($attribute, '余额调整审核校验码失败');
+            $this->addError($attribute, \Yii::t('ctx', 'adjustmentBalanceCodeFailed'));
         }
     }
 
@@ -220,7 +220,7 @@ class ChangeBalanceForm extends Model {
      */
     public function isSelected($attributes) {
         if (!$this->selected) {
-            $this->addError($attributes, 'A piece of data must be selected'); // 必须选择一条数据
+            $this->addError($attributes, \Yii::t('ctx', 'aPieceMustBeSelected')); // 必须选择一条数据
         }
         if (!is_array($this->selected)) {
             $this->selected = [$this->selected];
@@ -244,7 +244,7 @@ class ChangeBalanceForm extends Model {
         $this->selected = array_values($this->selected);
 
         if (!$this->selected) {
-            $this->addError($attributes, '没有符合条件的数据');
+            $this->addError($attributes, \Yii::t('ctx', 'noEligibleData'));
         }
     }