refine webfront pages

finish refactor of penalty information/profile
optimize pull penalty query
start impl of quick message mapping
This commit is contained in:
RaidMax
2019-03-31 19:56:31 -05:00
parent 9393b35c39
commit 6f80f1edbb
23 changed files with 253 additions and 283 deletions

View File

@ -89,16 +89,30 @@ namespace IW4MAdmin.Plugins.Stats.Web.Controllers
{
using (var ctx = new SharedLibraryCore.Database.DatabaseContext(true))
{
var penaltyInfo = await ctx.Set<Models.EFACSnapshot>()
.Where(s => s.ClientId == clientId)
int linkId = await ctx.Clients
.Where(_client => _client.ClientId == clientId)
.Select(_client => _client.AliasLinkId)
.FirstOrDefaultAsync();
var clientIds = await ctx.Clients.Where(_client => _client.AliasLinkId == linkId)
.Select(_client => _client.ClientId)
.ToListAsync();
var iqPenaltyInfo = ctx.Set<Models.EFACSnapshot>()
.Where(s => clientIds.Contains(s.ClientId))
.Include(s => s.LastStrainAngle)
.Include(s => s.HitOrigin)
.Include(s => s.HitDestination)
.Include(s => s.CurrentViewAngle)
.Include(s => s.PredictedViewAngles)
.OrderBy(s => s.When)
.ThenBy(s => s.Hits)
.ToListAsync();
.ThenBy(s => s.Hits);
#if DEBUG == true
var sql = iqPenaltyInfo.ToSql();
#endif
var penaltyInfo = await iqPenaltyInfo.ToListAsync();
return View("_PenaltyInfo", penaltyInfo);
}