|
|
@@ -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'));
|
|
|
}
|
|
|
}
|
|
|
|