|
|
@@ -43,8 +43,8 @@ class RechargeForm extends Model {
|
|
|
return [
|
|
|
[['userName', 'idCard', 'applyAmount', 'auditStatus', 'remark', 'selectedIds', 'sn','amount', 'bankRealName', 'bankNo'], 'trim'],
|
|
|
[['selectedIds', 'auditStatus', 'userName','applyAmount','openBank','bankNo'/*,'bankAddress'*/], 'required'],
|
|
|
- [['selectedIds'], 'exist', 'targetClass' => Recharge::class, 'targetAttribute' => 'ID', 'message' => '充值申请不存在'],
|
|
|
- [['userName'], 'exist', 'targetClass' => UserInfo::class, 'targetAttribute' => 'USER_NAME', 'message' => '会员不存在'],
|
|
|
+ [['selectedIds'], 'exist', 'targetClass' => Recharge::class, 'targetAttribute' => 'ID', 'message' => 'Recharge does not exist'], // 充值申请不存在
|
|
|
+ [['userName'], 'exist', 'targetClass' => UserInfo::class, 'targetAttribute' => 'USER_NAME', 'message' => 'Member does not exist'],// 会员不存在
|
|
|
[['applyAmount'], 'price'],
|
|
|
[['applyAmount'], 'isApplyAmount'],
|
|
|
[['applyAmount'], 'number', 'max' => 10000000000, 'min' => 1],
|
|
|
@@ -72,11 +72,11 @@ class RechargeForm extends Model {
|
|
|
*/
|
|
|
public function attributeLabels() {
|
|
|
return [
|
|
|
- 'selectedIds' => '充值申请ID',
|
|
|
- 'userName' => '会员编号',
|
|
|
+ 'selectedIds' => 'RechargeID',// 充值申请ID
|
|
|
+ 'userName' => 'Member code',// 会员编号
|
|
|
'applyAmount' => 'Apply Amount', // 申请充值的金额
|
|
|
- 'openBank' => '汇款银行',
|
|
|
- 'bankNo' => '汇款账号',
|
|
|
+ 'openBank' => 'Bank name',// 汇款银行
|
|
|
+ 'bankNo' => 'Bank account', // 汇款账号
|
|
|
// 'bankAddress' => '银行支行',
|
|
|
// 'bankProvince' => '银行省',
|
|
|
// 'bankCity' => '银行市',
|
|
|
@@ -91,22 +91,22 @@ class RechargeForm extends Model {
|
|
|
*/
|
|
|
public function isApplyAmount($attribute) {
|
|
|
if ($this->applyAmount <= 0) {
|
|
|
- $this->addError('scenario', '充值金额必须大于0');
|
|
|
+ $this->addError('scenario', 'The recharge amount must be greater than 0'); // 充值金额必须大于0
|
|
|
}
|
|
|
if ((int)($this->applyAmount)!=$this->applyAmount) {
|
|
|
- $this->addError('scenario', '充值金额必须是整数');
|
|
|
+ $this->addError('scenario', 'The recharge amount must be an integer');// 充值金额必须是整数
|
|
|
}
|
|
|
if ($this->scenario == 'addByUser') {
|
|
|
$this->_userId = \Yii::$app->user->id;
|
|
|
} elseif ($this->scenario == 'addByAdmin') {
|
|
|
$userInfo = UserInfo::findOneAsArray(['USER_NAME' => $this->userName]);
|
|
|
if (!$userInfo) {
|
|
|
- $this->addError('scenario', $this->userName . '会员不存在');
|
|
|
+ $this->addError('scenario', $this->userName . 'Member does not exist');// 会员不存在
|
|
|
}else{
|
|
|
$this->_userId = $userInfo['USER_ID'];
|
|
|
}
|
|
|
} else {
|
|
|
- $this->addError($attribute, '场景不存在');
|
|
|
+ $this->addError($attribute, 'Scenes does not exist'); // 场景不存在
|
|
|
return false;
|
|
|
}
|
|
|
}
|