|
|
@@ -52,9 +52,9 @@ class NetMoveForm extends Model {
|
|
|
return [
|
|
|
[['moveId', 'moveUserName', 'toConUserName', 'toConRealName', 'location', 'type', 'remark', 'auditStatus'], 'trim'],
|
|
|
[['moveId', 'moveUserName', 'toConUserName', 'toConRealName', 'location', 'type', 'remark', 'auditStatus'], 'required'],
|
|
|
- [['moveId'], 'exist', 'targetClass' => UserMove::class, 'targetAttribute' => 'ID', 'message' => '移网申请不存在'],
|
|
|
+ [['moveId'], 'exist', 'targetClass' => UserMove::class, 'targetAttribute' => 'ID', 'message' => 'The application to move the net does not exist'], // 移网申请不存在
|
|
|
[['moveId'], 'initModel'],
|
|
|
- [['moveUserName'], 'exist', 'targetClass' => UserInfo::class, 'targetAttribute' => 'USER_NAME', 'message' => '要移动的会员不存在'],
|
|
|
+ [['moveUserName'], 'exist', 'targetClass' => UserInfo::class, 'targetAttribute' => 'USER_NAME', 'message' => 'The member to move does not exist'],// 要移动的会员不存在
|
|
|
[['location'], 'integer'],
|
|
|
[['location'], 'isLocation'],
|
|
|
[['type'], 'isType'],
|
|
|
@@ -85,14 +85,14 @@ class NetMoveForm extends Model {
|
|
|
*/
|
|
|
public function attributeLabels() {
|
|
|
return [
|
|
|
- 'moveId' => '移网申请Id',
|
|
|
- 'moveUserName' => '要移动的会员编号',
|
|
|
- 'toConUserName' => '移动到的会员编号',
|
|
|
- 'toConRealName' => '移动到的会员姓名',
|
|
|
- 'location' => '位置',
|
|
|
- 'type' => '移网类型',
|
|
|
- 'remark' => '备注',
|
|
|
- 'auditStatus' => '状态',
|
|
|
+ 'moveId' => 'Id of the network transfer application',// 移网申请Id
|
|
|
+ 'moveUserName' => 'The member code to be moved',// 要移动的会员编号
|
|
|
+ 'toConUserName' => 'The member code to which to move',//移动到的会员编号
|
|
|
+ 'toConRealName' => 'Member name to move to',//移动到的会员姓名
|
|
|
+ 'location' => 'Location',// 位置
|
|
|
+ 'type' => 'Moving network type',// 移网类型
|
|
|
+ 'remark' => 'Note',// 备注
|
|
|
+ 'auditStatus' => 'State',// 状态
|
|
|
];
|
|
|
}
|
|
|
|
|
|
@@ -103,7 +103,7 @@ class NetMoveForm extends Model {
|
|
|
public function initModel($attribute) {
|
|
|
$model = $this->_model = UserMove::findOne(['ID' => $this->moveId]);
|
|
|
if ($model->AUDIT_STATUS > \Yii::$app->params['auditStatus']['un']['value']) {
|
|
|
- $this->addError($attribute, '该申请已经被审核,不能重复审核');
|
|
|
+ $this->addError($attribute, 'The application has been reviewed and cannot be reviewed again');// 该申请已经被审核,不能重复审核
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -113,8 +113,8 @@ class NetMoveForm extends Model {
|
|
|
*/
|
|
|
public function isLocation($attribute) {
|
|
|
if ($this->type == NetPoint::NET_TYPE_NETWORK) {
|
|
|
- if (!in_array($this->location, [1, 2, 3])) {
|
|
|
- $this->addError($attribute, '区位不正确');
|
|
|
+ if (!in_array($this->location, [1, 2])) {
|
|
|
+ $this->addError($attribute, 'Incorrect location');//区位不正确
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -125,7 +125,7 @@ class NetMoveForm extends Model {
|
|
|
*/
|
|
|
public function isType($attribute) {
|
|
|
if (!in_array($this->type, [NetPoint::NET_TYPE_NETWORK, NetPoint::NET_TYPE_RELATION])) {
|
|
|
- $this->addError($attribute, '移网类型不正确');
|
|
|
+ $this->addError($attribute, 'The type of moving net is incorrect');// 移网类型不正确
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -138,7 +138,7 @@ class NetMoveForm extends Model {
|
|
|
*/
|
|
|
public function isMoveUser($attribute, $params) {
|
|
|
if ($this->moveUserName == $this->toConUserName) {
|
|
|
- $this->addError($attribute, '不能移动到自己点位下');
|
|
|
+ $this->addError($attribute, 'Cannot move to its own point');//不能移动到自己点位下
|
|
|
}
|
|
|
$this->_moveUserId = Info::getUserIdByUserName($this->moveUserName);
|
|
|
$this->_moveUserInfo = Info::baseInfo($this->_moveUserId);
|
|
|
@@ -151,7 +151,7 @@ class NetMoveForm extends Model {
|
|
|
$this->_toConUserId = Info::getUserIdByUserName($this->toConUserName);
|
|
|
|
|
|
if (!$this->_fromConUserInfo) {
|
|
|
- $this->addError($attribute, '原节点会员不存在,可能该会员是顶层会员不可移动');
|
|
|
+ $this->addError($attribute, 'The original node member does not exist. The member may be a top-level member and cannot be moved.');// 原节点会员不存在,可能该会员是顶层会员不可移动
|
|
|
}
|
|
|
if ($this->type == NetPoint::NET_TYPE_NETWORK) {
|
|
|
$this->_fromLocation = UserNetwork::getLocation($this->_moveUserId, $this->_fromConUserId);
|
|
|
@@ -159,12 +159,12 @@ class NetMoveForm extends Model {
|
|
|
// 原接点和新接点是否同一个
|
|
|
if ($this->_fromConUserId == $this->_toConUserId) {
|
|
|
if($this->type == NetPoint::NET_TYPE_RELATION){
|
|
|
- $this->addError($attribute, '节点位置没有发生变化');
|
|
|
+ $this->addError($attribute, 'The node position does not change');// 节点位置没有发生变化
|
|
|
}
|
|
|
elseif($this->type == NetPoint::NET_TYPE_NETWORK){
|
|
|
// 查看原区位
|
|
|
if($this->_fromLocation == $this->location){
|
|
|
- $this->addError($attribute, '节点位置没有发生变化');
|
|
|
+ $this->addError($attribute, 'The node position does not change');// 节点位置没有发生变化
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -185,7 +185,7 @@ class NetMoveForm extends Model {
|
|
|
foreach ($allChildUser as $child) {
|
|
|
$isLocation[$child['RELATIVE_LOCATION']] = true;
|
|
|
if ($child['RELATIVE_LOCATION'] == $this->location) {
|
|
|
- $this->addError($attribute, '新接点人的此区位已经存在会员');
|
|
|
+ $this->addError($attribute, 'The new node already has a member for this location');// 新接点人的此区位已经存在会员
|
|
|
}
|
|
|
}
|
|
|
// 第二区不能空点,必须要有会员才能注册到第三区
|
|
|
@@ -205,7 +205,7 @@ class NetMoveForm extends Model {
|
|
|
$modelClass = UserRelation::class;
|
|
|
}
|
|
|
if ($modelClass::isParentUser($this->_toConUserId, $this->_moveUserId)) {
|
|
|
- $this->addError($attribute, '不能移动到该会员的子会员点位下');
|
|
|
+ $this->addError($attribute, 'Cannot be moved to the sub-member point of the member');// 不能移动到该会员的子会员点位下
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -218,7 +218,7 @@ class NetMoveForm extends Model {
|
|
|
//移动到的节点会员不存在
|
|
|
$toUser = Info::baseInfo($this->_toConUserId);
|
|
|
if ($toUser['REAL_NAME'] != $this->toConRealName) {
|
|
|
- $this->addError($attribute, '移动到的会员账号和姓名不匹配');
|
|
|
+ $this->addError($attribute, 'The code and name of the member you moved to do not match');// 移动到的会员账号和姓名不匹配
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -231,24 +231,24 @@ class NetMoveForm extends Model {
|
|
|
$oneData = UserMove::findOneAsArray(['ID' => $this->moveId]);
|
|
|
switch ($this->auditStatus) {
|
|
|
case 'un':
|
|
|
- $this->addError($attribute, '不能设置为待审核状态' . $this->auditStatus);
|
|
|
+ $this->addError($attribute, 'Cannot be set to pending review' . $this->auditStatus); // 不能设置为待审核状态
|
|
|
break;
|
|
|
case 'true':
|
|
|
if ($oneData['AUDIT_STATUS'] == \Yii::$app->params['auditStatus']['true']['value']) {
|
|
|
- $this->addError($attribute, '已经审核通过不能重复审核');
|
|
|
+ $this->addError($attribute, 'The application has been passed and cannot be reviewed again'); // 已经审核通过不能重复审核
|
|
|
} elseif ($oneData['AUDIT_STATUS'] == \Yii::$app->params['auditStatus']['reject']['value']) {
|
|
|
- $this->addError($attribute, '已经审核拒绝不能重复审核');
|
|
|
+ $this->addError($attribute, 'The application has been rejected and cannot be reviewed again'); // 已经审核拒绝不能重复审核
|
|
|
}
|
|
|
break;
|
|
|
case 'reject':
|
|
|
if ($oneData['AUDIT_STATUS'] == \Yii::$app->params['auditStatus']['true']['value']) {
|
|
|
- $this->addError($attribute, '已经审核通过不能重复审核');
|
|
|
+ $this->addError($attribute, 'The application has been passed and cannot be reviewed again');// 已经审核通过不能重复审核
|
|
|
} elseif ($oneData['AUDIT_STATUS'] == \Yii::$app->params['auditStatus']['reject']['value']) {
|
|
|
- $this->addError($attribute, '已经审核拒绝不能重复审核');
|
|
|
+ $this->addError($attribute, 'The application has been rejected and cannot be reviewed again');// 已经审核拒绝不能重复审核
|
|
|
}
|
|
|
break;
|
|
|
default:
|
|
|
- $this->addError($attribute, '状态参数有误');
|
|
|
+ $this->addError($attribute, 'Status parameter error'); // 状态参数有误
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -276,7 +276,7 @@ class NetMoveForm extends Model {
|
|
|
} elseif ($this->type == NetPoint::NET_TYPE_RELATION) {
|
|
|
$model->TYPE = UserMove::TYPE_RELATION;
|
|
|
} else {
|
|
|
- throw new Exception('错误的移网类型');
|
|
|
+ throw new Exception('The type of moving net is incorrect'); // 错误的移网类型
|
|
|
}
|
|
|
$model->PERIOD_NUM = $period->getNowPeriodNum();
|
|
|
$model->MOVE_ADMIN_ID = \Yii::$app->user->id;
|
|
|
@@ -323,7 +323,7 @@ class NetMoveForm extends Model {
|
|
|
try {
|
|
|
$model = $this->_model;
|
|
|
if ($model->IS_MOVING == 1) {
|
|
|
- throw new Exception('该申请正在移网操作,不能重复编辑');
|
|
|
+ throw new Exception('This application is being transferred to the net and cannot be edited repeatedly');// 该申请正在移网操作,不能重复编辑
|
|
|
}
|
|
|
$model->USER_ID = $this->_moveUserId;
|
|
|
$model->FROM_UID = $this->_fromConUserId;
|
|
|
@@ -334,7 +334,7 @@ class NetMoveForm extends Model {
|
|
|
} elseif ($this->type == NetPoint::NET_TYPE_RELATION) {
|
|
|
$model->TYPE = UserMove::TYPE_RELATION;
|
|
|
} else {
|
|
|
- throw new Exception('类型不存在');
|
|
|
+ throw new Exception('The type of moving net is incorrect'); // 类型不存在
|
|
|
}
|
|
|
$model->CREATE_REMARK = $this->remark;
|
|
|
if (!$model->save()) {
|
|
|
@@ -369,7 +369,7 @@ class NetMoveForm extends Model {
|
|
|
try {
|
|
|
$model = $this->_model;
|
|
|
if ($model->IS_MOVING == 1) {
|
|
|
- throw new Exception('该申请正在移网操作,不能重复审核');
|
|
|
+ throw new Exception('This application is being transferred to the net and cannot be reviewed again'); // 该申请正在移网操作,不能重复审核
|
|
|
}
|
|
|
$model->USER_ID = $this->_moveUserId;
|
|
|
$model->FROM_UID = $this->_fromConUserId;
|
|
|
@@ -380,7 +380,7 @@ class NetMoveForm extends Model {
|
|
|
} elseif ($this->type == NetPoint::NET_TYPE_RELATION) {
|
|
|
$model->TYPE = UserMove::TYPE_RELATION;
|
|
|
} else {
|
|
|
- throw new Exception('类型不存在');
|
|
|
+ throw new Exception('The type of moving net is incorrect'); // 类型不存在
|
|
|
}
|
|
|
if (!$model->save()) {
|
|
|
throw new Exception(Form::formatErrorsForApi($model->getErrors()));
|
|
|
@@ -393,7 +393,7 @@ class NetMoveForm extends Model {
|
|
|
}
|
|
|
|
|
|
$this->adminOperateLogger->afterUpdate($model)->clean()->save([
|
|
|
- 'optType' => '审核通过移网',
|
|
|
+ 'optType' => 'Transfer net approved', // 审核通过移网
|
|
|
'userId' => $model->USER_ID,
|
|
|
'userName' => Info::getUserNameByUserId($model->USER_ID),
|
|
|
'remark' => $this->remark??''
|
|
|
@@ -401,11 +401,11 @@ class NetMoveForm extends Model {
|
|
|
|
|
|
$oneMove = UserMove::find()->select('UM.*, UMI.USER_NAME AS MOVE_USER_NAME, UTI.USER_NAME AS TO_USER_NAME')->from(UserMove::tableName() . ' AS UM')->join('LEFT JOIN', UserInfo::tableName() . ' AS UMI', 'UM.USER_ID=UMI.USER_ID')->join('LEFT JOIN', UserInfo::tableName() . ' AS UTI', 'UM.TO_UID=UTI.USER_ID')->where('UM.ID=:ID', [':ID' => $this->moveId])->asArray()->one();
|
|
|
if (!$oneMove) {
|
|
|
- $this->addError('audit', '移网申请不存在');
|
|
|
+ $this->addError('audit', 'The application to move the net does not exist'); // 移网申请不存在
|
|
|
return null;
|
|
|
}
|
|
|
if ($oneMove['AUDIT_STATUS'] > 0) {
|
|
|
- $this->addError('audit', '已审核过,不能审核');
|
|
|
+ $this->addError('audit', 'The application has been reviewed and cannot be reviewed again');// 已审核过,不能审核
|
|
|
return null;
|
|
|
}
|
|
|
$this->moveUserName = $oneMove['MOVE_USER_NAME'];
|
|
|
@@ -428,7 +428,7 @@ class NetMoveForm extends Model {
|
|
|
])->asArray()->one();
|
|
|
|
|
|
if( $oneData ) {
|
|
|
- $this->addError('edit', '有正在移网的数据,请稍后再操作。');
|
|
|
+ $this->addError('edit', 'There is data being moved, please operate later.'); // 有正在移网的数据,请稍后再操作。
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
@@ -496,7 +496,7 @@ class NetMoveForm extends Model {
|
|
|
$this->moveWebToAsync();
|
|
|
}
|
|
|
} else {
|
|
|
- $this->addError('audit', '错误的审核方式' . $this->auditStatus);
|
|
|
+ $this->addError('audit', 'The wrong way to audit' . $this->auditStatus); // 错误的审核方式
|
|
|
}
|
|
|
$this->adminOperateLogger->setIsBatch(true)->afterUpdate($this->selected,'ID')->clean()->save([
|
|
|
'optType' => '审核移网',
|
|
|
@@ -574,7 +574,7 @@ class NetMoveForm extends Model {
|
|
|
$period = Period::instance();
|
|
|
$moveModel = UserMove::findOne(['ID' => $this->moveId]);
|
|
|
if ($moveModel->IS_MOVING == 1) {
|
|
|
- $this->addError('moveWebToAsync', '正在移动中请稍候');
|
|
|
+ $this->addError('moveWebToAsync', 'Please wait while it is moving'); // 正在移动中请稍候
|
|
|
return null;
|
|
|
}
|
|
|
$moveModel->IS_MOVING = 1;
|
|
|
@@ -592,7 +592,7 @@ class NetMoveForm extends Model {
|
|
|
} elseif ($moveModel->TYPE === NetPoint::NET_TYPE_RELATION) {
|
|
|
$route = 'user/move-relation';
|
|
|
} else {
|
|
|
- $this->addError('scenario', '场景不存在');
|
|
|
+ $this->addError('scenario', 'The scene does not exist'); // 场景不存在
|
|
|
return null;
|
|
|
}
|
|
|
// 异步处理添加任务
|
|
|
@@ -608,7 +608,7 @@ class NetMoveForm extends Model {
|
|
|
$taskKey = \Yii::$app->swooleAsyncTimer->asyncHandle($route, $params);
|
|
|
if ($taskKey === false) {
|
|
|
$this->errorHandle();
|
|
|
- $this->addError('send', '请求失败');
|
|
|
+ $this->addError('send', 'The request failed'); // 请求失败
|
|
|
return null;
|
|
|
}
|
|
|
return $moveModel;
|
|
|
@@ -639,7 +639,7 @@ class NetMoveForm extends Model {
|
|
|
} elseif ($this->type == NetPoint::NET_TYPE_RELATION) {
|
|
|
$moveResult = $netPoint->moveRelationPoint($this->_moveUserId, $this->_toConUserId);
|
|
|
} else {
|
|
|
- $this->addError('netType', '移网的网络类型错误');
|
|
|
+ $this->addError('netType', 'The type of moving net is incorrect'); // 移网的网络类型错误
|
|
|
unset($netPoint);
|
|
|
return null;
|
|
|
}
|
|
|
@@ -679,7 +679,7 @@ class NetMoveForm extends Model {
|
|
|
*/
|
|
|
public function delete($selected) {
|
|
|
$this->adminOperateLogger->clean()->save([
|
|
|
- 'optType' => '删除移网',
|
|
|
+ 'optType' => 'Delete move network', // 删除移网
|
|
|
]);
|
|
|
}
|
|
|
}
|