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

+ 1 - 1
backendApi/modules/v1/controllers/BaseController.php

@@ -190,7 +190,7 @@ class BaseController extends \yii\rest\ActiveController {
             $selected = \Yii::$app->request->post('selected');
         }
         if (!$selected) {
-            return self::notice('must select one item to delete', 500);// 必须选择一条删除数据
+            return self::notice(Yii::t('ctx', 'mustSelectOneItemToDelete'), 500);// 必须选择一条删除数据
         }
 
         // 是否存在 DONT_DEL 字段

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

@@ -186,7 +186,7 @@ class FinanceController extends BaseController {
         if ($formModel->load(Yii::$app->request->post(), '') && $result = $formModel->edit()) {
             // $user = User::getBaseInfoFromRedis($result['USER_ID']);
             // Log::adminHandle('修改' . $user['USER_NAME'] . '调整会员余额录入数据', 1, $result['USER_ID'], $user['USER_NAME']);
-            return static::notice('Modification and adjustment of member balance entry data completed'); // 修改调整会员余额录入数据完成
+            return static::notice(Yii::t('ctx', 'modificationAdjustmentMemberBalanceCompleted')); // 修改调整会员余额录入数据完成
         }
         return static::notice(Form::formatErrorsForApi($formModel->getErrors()), 400);
     }
@@ -203,7 +203,7 @@ class FinanceController extends BaseController {
         if ($formModel->load(Yii::$app->request->post(), '') && $result = $formModel->pass()) {
             $user = User::getBaseInfoFromRedis($result['USER_ID']);
             // Log::adminHandle('审核通过' . $user['USER_NAME'] . '调整会员余额录入数据', 1, $result['USER_ID'], $user['USER_NAME']);
-            return static::notice('The review is done through the member balance'); // 审核通过会员余额完成
+            return static::notice(Yii::t('ctx', 'reviewThroughMemberBalance')); // 审核通过会员余额完成
         }
         return static::notice(Form::formatErrorsForApi($formModel->getErrors()), 400);
     }
@@ -222,7 +222,7 @@ class FinanceController extends BaseController {
                 $userName = Info::getUserNameByUserId($value['userId']);
                 // Log::adminHandle('审核调整会员余额录入数据' . $userName . '发放' . $value['type'], 1, $value['userId'], $userName);
             }*/
-            return static::notice('Batch audit/audit reject member balance completed'); // 批量审核/审核拒绝会员余额完成
+            return static::notice(Yii::t('ctx', 'batchAuditMemberBalanceCompleted')); // 批量审核/审核拒绝会员余额完成
         }
         return static::notice(Form::formatErrorsForApi($formModel->getErrors()), 400);
     }
@@ -364,7 +364,7 @@ class FinanceController extends BaseController {
      */
     public function actionWithdrawAdd() {
         if (Yii::$app->request->isPost) {// 新增会员提现成功
-            return parent::edit(WithdrawForm::class, 'The newly added member successfully withdrew cash', 'addByAdmin', ['add'], null, function ($form, $result) {
+            return parent::edit(WithdrawForm::class, Yii::t('ctx', 'addedMemberSuccessfullyWithdrewCash'), 'addByAdmin', ['add'], null, function ($form, $result) {
                 $user = User::getBaseInfoFromRedis($result['USER_ID']);
                 // Log::adminHandle('申请为' . $user['USER_NAME'] . '提现' . $result['WITHDRAW_AMOUNT'], 1, $result['USER_ID'], $user['USER_NAME']);
             });
@@ -384,7 +384,7 @@ class FinanceController extends BaseController {
         $id = Yii::$app->request->get('id');
         $withdraw = Withdraw::findOneAsArray('ID=:ID', [':ID' => $id]);
         if (!$withdraw) {
-            return static::notice('The data does not exist', 400); // 数据不存在
+            return static::notice(Yii::t('ctx', 'dataDoesNotExists'), 400); // 数据不存在
         }
         $withdraw['BASE_INFO'] = Info::baseInfoZh($withdraw['USER_ID']);
         $withdraw['PLAN_PAID_AT'] = $withdraw['PLAN_PAID_AT'] ? Date::convert($withdraw['PLAN_PAID_AT']) : null;
@@ -406,7 +406,7 @@ class FinanceController extends BaseController {
             if ($formModel->load(Yii::$app->request->post(), '') && $result = $formModel->editByAdmin()) {
                 $user = User::getBaseInfoFromRedis($result['USER_ID']);
                 // Log::adminHandle('修改提现信息,ID为:' . $result['ID'], 1, $result['USER_ID'], $user['USER_NAME']);
-                return static::notice('The withdrawal information is modified successfully.'); // 修改提现信息成功
+                return static::notice(Yii::t('ctx', 'withdrawalInformationModifiedSuccessfully')); // 修改提现信息成功
             } else {
                 return static::notice(Form::formatErrorsForApi($formModel->getErrors()), 400);
             }

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

@@ -16,9 +16,29 @@ return [
     'adjustmentBalanceCodeFailed' => 'Balance adjustment review verification code failed',
     'aPieceMustBeSelected' => 'A piece of data must be selected',
     'noEligibleData' => 'No eligible data',
+    'modificationAdjustmentMemberBalanceCompleted'=>'Modification and adjustment of member balance entry data completed',
+    'reviewThroughMemberBalance'=>'The review is done through the member balance',
+    'batchAuditMemberBalanceCompleted'=>'Batch audit/audit reject member balance completed',
+    'addedMemberSuccessfullyWithdrewCash' => 'The newly added member successfully withdrew cash',
+    'withdrawalInformationModifiedSuccessfully'=>'The withdrawal information is modified successfully',
+    'withdrawalApplyDoesNotExist'=>'The withdrawal application does not exist',
+    'memberNameOrNumberInconsistentSystem' => 'The member name or ID number number entered is inconsistent with the system',
+    'memberRegisterTypeInconsistentWithSystem'=>'The selected member registration type is inconsistent with the system',
+    'withdrawalMustGreaterThanZero'=>'The withdrawal amount must be greater than 0',
+    'withdrawalAmountMustInteger' => 'Withdrawal amount must be an integer',
+    'withdrawalAmountCannotLessThan' => 'The withdrawal amount cannot be less than',
+    'WithdrawalAmountCannotHigherThan' => 'Withdrawal amount cannot be higher than',
+    'withdrawalAmountMustLessThanAvailableBalance' => 'The withdrawal amount must be less than the available balance of',
+    'paymentPasswordIncorrect' => 'The payment password is incorrect',
+    'failedApplyWithdrawalVerify' => 'Failed to apply for cash withdrawal verification',
+    'withdrawalAuditVerificationFailed' => 'Withdrawal audit verification failed',
+    'cannotSelectDateInThePast'=>'Cannot select a date in the past',
 
     # 公用
+    'amountUnit' => '₦',
+    'sceneDoesNotExist' => 'Scene does not exist',
     'memberDoesNotExist' => 'Member does not exist',
+    'mustSelectOneItemToDelete' => 'must select one item to delete',
     'dataNotExists' => 'Data not exists',
     'startExporting'=> 'Starting exporting, please go to File Management - Export Files to view.',
     'incorrectDateFormat' => 'Incorrect date format',

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

@@ -16,9 +16,29 @@ return [
     'adjustmentBalanceCodeFailed' => '余额调整审核校验码失败',
     'aPieceMustBeSelected' => '必须选择一条数据',
     'noEligibleData' => '没有符合条件的数据',
+    'modificationAdjustmentMemberBalanceCompleted'=>'修改调整会员余额录入数据完成',
+    'reviewThroughMemberBalance'=>'审核通过会员余额完成',
+    'batchAuditMemberBalanceCompleted'=>'批量审核/审核拒绝会员余额完成',
+    'addedMemberSuccessfullyWithdrewCash' => '新增会员提现成功',
+    'withdrawalInformationModifiedSuccessfully'=>'修改提现信息成功',
+    'withdrawalApplyDoesNotExist'=>'提现申请不存在',
+    'memberNameOrNumberInconsistentSystem' => '输入的会员姓名或身份证号与系统不一致',
+    'memberRegisterTypeInconsistentWithSystem'=>'选择的会员注册类型与系统不一致',
+    'withdrawalMustGreaterThanZero'=>'提现金额必须大于0',
+    'withdrawalAmountMustInteger'=>'提现金额必须是整数',
+    'withdrawalAmountCannotLessThan' => '提现金额不能少于',
+    'WithdrawalAmountCannotHigherThan' => '提现金额不能高于',
+    'withdrawalAmountMustLessThanAvailableBalance' => '提现金额必须小于的可用余额',
+    'paymentPasswordIncorrect' => '支付密码不正确',
+    'failedApplyWithdrawalVerify' => '申请提现校验失败',
+    'withdrawalAuditVerificationFailed' => '提现审核校验失败',
+    'cannotSelectDateInThePast'=>'不能选择过去的日期',
 
     # 公用
+    'amountUnit' => '元',
+    'sceneDoesNotExist' => '场景不存在',
     'memberDoesNotExist' => '会员不存在',
+    'mustSelectOneItemToDelete' => '必须选择一条删除数据',
     'dataNotExists' => '数据不存在',
     'startExporting'=> '导出开始,请到文件管理-导出文件查看',
     'incorrectDateFormat' => '日期筛选格式不对',

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

@@ -73,8 +73,8 @@ class WithdrawForm extends Model {
         return [
             [['id', 'userName', 'realName', 'idCard', 'regType', 'applyAmount', 'payPassword', 'planPaidAt', 'auditStatus', 'createdAt', 'remark', 'createRemark', 'selectedIds', 'sn', 'withdrawPeriodNum', 'paidAt', 'paidFailRemark', 'amount', 'bankRealName', 'bankNo'], 'trim'],
             [['id', 'userName', 'applyAmount', 'payPassword', 'auditStatus','withdrawCode','withdrawAudit'], 'required'],
-            [['id'], 'exist', 'targetClass' => Withdraw::class, 'targetAttribute' => 'ID', 'message' => '提现申请不存在'],
-            [['userName'], 'exist', 'targetClass' => UserInfo::class, 'targetAttribute' => 'USER_NAME', 'message' => '会员不存在'],
+            [['id'], 'exist', 'targetClass' => Withdraw::class, 'targetAttribute' => 'ID', 'message' => Yii::t('ctx', 'withdrawalApplyDoesNotExist')],
+            [['userName'], 'exist', 'targetClass' => UserInfo::class, 'targetAttribute' => 'USER_NAME', 'message' => Yii::t('ctx', 'memberDoesNotExist')],
             [['applyAmount'], 'price'],
             [['applyAmount'], 'isApplyAmount'],
             [['userName'], 'isUserName'],
@@ -131,15 +131,15 @@ class WithdrawForm extends Model {
             if ($this->scenario == 'addByAdmin') {
                 $baseInfo = Info::baseInfoZh($userInfo['USER_ID']);
                 if ($baseInfo['REAL_NAME'] != $this->realName || $baseInfo['ID_CARD'] != $this->idCard) {
-                    $this->addError($attributes, '输入的会员姓名或身份证号与系统不一致');
+                    $this->addError($attributes, Yii::t('ctx', 'memberNameOrNumberInconsistentSystem'));
                 }
                 if ($userInfo['REG_TYPE'] != $this->regType) {
-                    $this->addError($attributes, '选择的会员注册类型与系统不一致');
+                    $this->addError($attributes, Yii::t('ctx', 'memberRegisterTypeInconsistentWithSystem'));
                 }
             }
             $this->_userId = $userInfo['USER_ID'];
         } else {
-            $this->addError($attributes, $this->userName . 'Member does not exist'); // 会员不存在
+            $this->addError($attributes, $this->userName . Yii::t('ctx', 'memberDoesNotExist'));
         }
     }
 
@@ -151,10 +151,10 @@ class WithdrawForm extends Model {
     public function isApplyAmount($attribute) {
         $config = Cache::getSystemConfig();
         if ($this->applyAmount <= 0) {
-            $this->addError('scenario', '提现金额必须大于0');
+            $this->addError('scenario', Yii::t('ctx', 'withdrawalMustGreaterThanZero'));
         }
         if ((int)($this->applyAmount)!=$this->applyAmount) {
-            $this->addError('scenario', '提现金额必须是整数');
+            $this->addError('scenario', Yii::t('ctx', 'withdrawalAmountMustInteger'));
         }
         $minAmount = 0;
         $maxAmount = 0;
@@ -166,14 +166,14 @@ class WithdrawForm extends Model {
             $userInfo = UserInfo::findOneAsArray(['USER_NAME' => $this->userName]);
             $this->_userId = $userInfo['USER_ID'];
         } else {
-            $this->addError($attribute, '场景不存在');
+            $this->addError($attribute, Yii::t('ctx', 'sceneDoesNotExist'));
             return false;
         }
         if ($minAmount != 0 && $this->applyAmount < $minAmount) {
-            $this->addError($attribute, '提现金额不能少于' . $minAmount . '元');
+            $this->addError($attribute, Yii::t('ctx', 'withdrawalAmountCannotLessThan') . $minAmount . Yii::t('ctx', 'amountUnit'));
         }
         if ($maxAmount != 0 && $this->applyAmount > $maxAmount) {
-            $this->addError($attribute, '提现金额不能高于' . $maxAmount . '元');
+            $this->addError($attribute, Yii::t('ctx', 'WithdrawalAmountCannotHigherThan') . $maxAmount . Yii::t('ctx', 'amountUnit'));
         }
 
         // 提现条件判断
@@ -186,7 +186,7 @@ class WithdrawForm extends Model {
 //        }
         // 获取当前提现用户的金额
         if ($this->applyAmount > Balance::getAvailableBalance($this->_userId)) {
-            $this->addError('scenario', '提现金额必须小于的可用余额');
+            $this->addError('scenario', Yii::t('ctx', 'withdrawalAmountMustLessThanAvailableBalance'));
         }
     }
 
@@ -197,7 +197,7 @@ class WithdrawForm extends Model {
      */
     public function validatePassword($attribute, $params) {
         if (!User::validatePayPassword($this->_userId, $this->payPassword)) {
-            $this->addError($attribute, 'The payment password is incorrect');//支付密码不正确
+            $this->addError($attribute, Yii::t('ctx', 'paymentPasswordIncorrect'));//支付密码不正确
         }
     }
 
@@ -206,7 +206,7 @@ class WithdrawForm extends Model {
         $redisCode = \Yii::$app->redis->getset('withdrawCode_'.$uid,'');
         \Yii::$app->redis->del('withdrawCode_'.$uid);
         if ($this->withdrawCode!=$redisCode) {
-            $this->addError($attribute, '申请提现校验失败');
+            $this->addError($attribute, Yii::t('ctx', 'failedApplyWithdrawalVerify'));
         }
     }
 
@@ -214,7 +214,7 @@ class WithdrawForm extends Model {
         $adminId = \Yii::$app->user->id;
         $redisCode = \Yii::$app->redis->getset('withdrawAudit_'.$adminId,'');
         if ($this->withdrawAudit!=$redisCode) {
-            $this->addError($attribute, '提现审核校验失败');
+            $this->addError($attribute, Yii::t('ctx', 'withdrawalAuditVerificationFailed'));
         }
     }
 
@@ -224,7 +224,7 @@ class WithdrawForm extends Model {
      */
     public function isSelected($attributes) {
         if (!$this->selectedIds) {
-            $this->addError($attributes, 'A piece of data must be selected'); // 必须选择一条数据
+            $this->addError($attributes, Yii::t('ctx', 'aPieceMustBeSelected')); // 必须选择一条数据
         }
         if (!is_array($this->selectedIds)) {
             $this->selectedIds = [$this->selectedIds];
@@ -244,7 +244,7 @@ class WithdrawForm extends Model {
      */
     public function isPlanPaidAt($attribute) {
         if (Date::utcToTime($this->planPaidAt) < Date::nowTime()) {
-            $this->addError($attribute, '不能选择过去的日期');
+            $this->addError($attribute, Yii::t('ctx', 'cannotSelectDateInThePast'));
         }
     }