master
ELF 4 years ago
parent 6d5d40dfd2
commit 78a24c78f5

@ -338,12 +338,12 @@ class TestingResourceService
throw new \Exception('该玩家账号为测试账号,无法绑定');
}
/* $existBind = M('testing_binding', 'tab_')->field(['id'])->where(['game_id' => $gameId, 'bind_role_id' => $bindRoleId])->find();
if ($existBind) {
throw new \Exception('该玩家角色已被绑定');
} */
$existBindCount = M('testing_binding', 'tab_')->where(['game_id' => ['in', $gameIds], 'bind_role_id' => $bindRoleId])->count();
if ($existBindCount >= 2) {
throw new \Exception('同一游戏最多只能绑定两个角色');
}
$testExistBind = M('testing_binding', 'tab_')->field(['id'])->where(['game_id' => $gameId, 'role_id' => $testingRoleId])->find();
$testExistBind = M('testing_binding', 'tab_')->field(['id'])->where(['game_id' => ['in', $gameIds], 'role_id' => $testingRoleId])->find();
if ($testExistBind) {
throw new \Exception('该测试账号角色已绑定有角色');
}

Loading…
Cancel
Save