diff --git a/DSFServices/Services/PlayerStatisticsService.cs b/DSFServices/Services/PlayerStatisticsService.cs index f9e3456f..eb039c1c 100644 --- a/DSFServices/Services/PlayerStatisticsService.cs +++ b/DSFServices/Services/PlayerStatisticsService.cs @@ -178,6 +178,14 @@ public RMCResult ReadStatsLeaderboardByRange(int boardId, int columnId, int rank var playerStats = new List(); uint playersTotal = 0; + using (var db = DBHelper.GetDbContext()) + { + var playerBoards = db.PlayerStatisticBoards + .Where(x => x.BoardId == boardId); + + playersTotal = (uint)playerBoards.Count(); + } + return Result(new { a = playerStats, b = playersTotal }); } @@ -187,6 +195,18 @@ public RMCResult ReadStatsLeaderboardByPIDs(IEnumerable dataLis var playerStats = new List(); uint playersTotal = 0; + using (var db = DBHelper.GetDbContext()) + { + foreach(var data in dataList) + { + var playerBoards = db.PlayerStatisticBoards + .Where(x => x.BoardId == data.boardId) + .Where(x => playerPIDs.Contains(x.PlayerId)); + + playersTotal += (uint)playerBoards.Count(); + } + } + return Result(new { a = playerStats, b = playersTotal }); }