修改首页排行榜

This commit is contained in:
zpc 2024-12-01 07:02:09 +08:00
parent a9091b8d3a
commit bd79a1340e

View File

@ -403,6 +403,20 @@ namespace CloudGaming.Code.Game
gameListDtos.Add(new GameHistoryListDto(gameInfo, list[gameId], ImageResStyle.LOGO));
}
}
if (gameListDtos.Count < 20)
{
//gameListDtos.Add
var gamelist = gameCache.DataList.Where(it => !gameListDtos.Any(game => game.GameId == it.GameId));
var l = gamelist.OrderBy(it => new Random().Next(0, 999)).ToList();
foreach (var g in l)
{
gameListDtos.Add(new GameHistoryListDto(g, 0, ImageResStyle.LOGO));
if (gameListDtos.Count > 20)
{
break;
}
}
}
return gameListDtos;
}
}