|
|
@ -205,7 +205,8 @@ class TestingResourceService
|
|
|
|
$strCondition = '1=1';
|
|
|
|
$strCondition = '1=1';
|
|
|
|
if ($promote) {
|
|
|
|
if ($promote) {
|
|
|
|
$promoteService = new PromoteService();
|
|
|
|
$promoteService = new PromoteService();
|
|
|
|
$strCondition .= ' and promote_id in (' . $promoteService->subInSql($promote) . ')';
|
|
|
|
$permissionPromote = $promoteService->getTSPermPromote($promote);
|
|
|
|
|
|
|
|
$strCondition .= ' and promote_id in (' . $promoteService->subInSql($permissionPromote) . ')';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$users = M('user', 'tab_')->field(['id', 'account'])->where(['account' => ['in', $newAccounts], '_string' => $strCondition])->select();
|
|
|
|
$users = M('user', 'tab_')->field(['id', 'account'])->where(['account' => ['in', $newAccounts], '_string' => $strCondition])->select();
|
|
|
@ -293,8 +294,9 @@ class TestingResourceService
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$promoteService = new PromoteService();
|
|
|
|
$promoteService = new PromoteService();
|
|
|
|
|
|
|
|
$permissionPromote = $promoteService->getTSPermPromote($promote);
|
|
|
|
$testPromote = M('promote', 'tab_')->field(['id', 'chain'])->where(['id' => $testingRole['promote_id']])->find();
|
|
|
|
$testPromote = M('promote', 'tab_')->field(['id', 'chain'])->where(['id' => $testingRole['promote_id']])->find();
|
|
|
|
if (is_null($testPromote) || ($promote && !$promoteService->isSubOrSelf($testPromote, $promote))) {
|
|
|
|
if (is_null($testPromote) || ($permissionPromote && !$promoteService->isSubOrSelf($testPromote, $permissionPromote))) {
|
|
|
|
throw new \Exception('测试角色所属推广员异常');
|
|
|
|
throw new \Exception('测试角色所属推广员异常');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -307,7 +309,7 @@ class TestingResourceService
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$bindPromote = M('promote', 'tab_')->field(['id', 'chain'])->where(['id' => $bindRole['promote_id']])->find();
|
|
|
|
$bindPromote = M('promote', 'tab_')->field(['id', 'chain'])->where(['id' => $bindRole['promote_id']])->find();
|
|
|
|
if (is_null($bindPromote) || ($promote && !$promoteService->isSubOrSelf($bindPromote, $promote))) {
|
|
|
|
if (is_null($bindPromote) || ($permissionPromote && !$promoteService->isSubOrSelf($bindPromote, $permissionPromote))) {
|
|
|
|
throw new \Exception('玩家账号所属推广员异常');
|
|
|
|
throw new \Exception('玩家账号所属推广员异常');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -357,7 +359,9 @@ class TestingResourceService
|
|
|
|
$userAccount = $params['user_account'] ?? '';
|
|
|
|
$userAccount = $params['user_account'] ?? '';
|
|
|
|
$records = $params['records'] ?? [];
|
|
|
|
$records = $params['records'] ?? [];
|
|
|
|
|
|
|
|
|
|
|
|
if ($promote && $promote['level'] > 2) {
|
|
|
|
$promoteService = new PromoteService();
|
|
|
|
|
|
|
|
$permissionPromote = $promoteService->getTSPermPromote($promote);
|
|
|
|
|
|
|
|
if ($permissionPromote && $permissionPromote['level'] > 2) {
|
|
|
|
throw new \Exception('权限不足');
|
|
|
|
throw new \Exception('权限不足');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -394,8 +398,6 @@ class TestingResourceService
|
|
|
|
throw new \Exception('区服不存在');
|
|
|
|
throw new \Exception('区服不存在');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$promoteService = new PromoteService();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$role = M('user_play_info', 'tab_')
|
|
|
|
$role = M('user_play_info', 'tab_')
|
|
|
|
->field(['id', 'role_id', 'promote_id', 'game_id', 'testing_other_quota'])
|
|
|
|
->field(['id', 'role_id', 'promote_id', 'game_id', 'testing_other_quota'])
|
|
|
|
->where(['user_id' => $user['id'], 'game_id' => $gameId, 'server_id' => $server['server_id'], 'role_id' => $roleId])
|
|
|
|
->where(['user_id' => $user['id'], 'game_id' => $gameId, 'server_id' => $server['server_id'], 'role_id' => $roleId])
|
|
|
@ -418,7 +420,7 @@ class TestingResourceService
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$testPromote = M('promote', 'tab_')->field(['id', 'chain'])->where(['id' => $role['promote_id']])->find();
|
|
|
|
$testPromote = M('promote', 'tab_')->field(['id', 'chain'])->where(['id' => $role['promote_id']])->find();
|
|
|
|
if (is_null($testPromote) || ($promote && !$promoteService->isSubOrSelf($testPromote, $promote))) {
|
|
|
|
if (is_null($testPromote) || ($permissionPromote && !$promoteService->isSubOrSelf($testPromote, $permissionPromote))) {
|
|
|
|
throw new \Exception('测试角色所属推广员异常');
|
|
|
|
throw new \Exception('测试角色所属推广员异常');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -433,7 +435,7 @@ class TestingResourceService
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$bindingRole['binding_time'] = $binding['create_time'];
|
|
|
|
$bindingRole['binding_time'] = $binding['create_time'];
|
|
|
|
$bindPromote = M('promote', 'tab_')->field(['id', 'chain'])->where(['id' => $bindingRole['promote_id']])->find();
|
|
|
|
$bindPromote = M('promote', 'tab_')->field(['id', 'chain'])->where(['id' => $bindingRole['promote_id']])->find();
|
|
|
|
if (is_null($bindPromote) || ($promote && !$promoteService->isSubOrSelf($bindPromote, $promote))) {
|
|
|
|
if (is_null($bindPromote) || ($permissionPromote && !$promoteService->isSubOrSelf($bindPromote, $permissionPromote))) {
|
|
|
|
throw new \Exception('绑定角色所属推广员异常');
|
|
|
|
throw new \Exception('绑定角色所属推广员异常');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/* if ($testPromote['id'] != $bindPromote['id']) {
|
|
|
|
/* if ($testPromote['id'] != $bindPromote['id']) {
|
|
|
|