diff --git a/Application/Base/Service/TestingResourceService.class.php b/Application/Base/Service/TestingResourceService.class.php index 1fbccfdbd..c5fb49c11 100644 --- a/Application/Base/Service/TestingResourceService.class.php +++ b/Application/Base/Service/TestingResourceService.class.php @@ -441,9 +441,18 @@ class TestingResourceService $bindingRole = null; if ($binding) { + + $gameRepository = new GameRepository(); + $baseGames = $gameRepository->getBaseGames(); + $gameIds = [$gameId]; + if ($game['data_share'] == 1) { + $baseGame = $gameRepository->getBaseGameByGameId($gameId, $baseGames); + $gameIds = $gameRepository->getGameIdsByBaseGame($baseGame); + } + $bindingRole = M('user_play_info', 'tab_') ->field(['id', 'role_id', 'user_id', 'promote_id', 'game_id']) - ->where(['game_id' => $gameId, 'role_id' => $binding['bind_role_id']]) + ->where(['game_id' => ['in', $gameIds], 'role_id' => $binding['bind_role_id']]) ->find(); if (is_null($bindingRole)) { throw new \Exception('绑定玩家角色不存在');