mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-07-29 08:28:39 +00:00
Merge branch 'main' into server-split
This commit is contained in:
commit
bb03a01246
1 changed files with 5 additions and 3 deletions
|
@ -56,7 +56,11 @@ public class SlotsPage : BaseLayout
|
|||
|
||||
this.SearchValue = name.Trim();
|
||||
|
||||
this.SlotCount = await this.Database.Slots.CountAsync(p => p.Name.Contains(this.SearchValue));
|
||||
this.SlotCount = await this.Database.Slots.Include(p => p.Creator)
|
||||
.Where(p => p.Name.Contains(finalSearch.ToString()))
|
||||
.Where(p => p.Creator != null && (targetAuthor == null || string.Equals(p.Creator.Username.ToLower(), targetAuthor.ToLower())))
|
||||
.Where(p => targetGame == null || p.GameVersion == targetGame)
|
||||
.CountAsync();
|
||||
|
||||
this.PageNumber = pageNumber;
|
||||
this.PageAmount = Math.Max(1, (int)Math.Ceiling((double)this.SlotCount / ServerStatics.PageSize));
|
||||
|
@ -72,8 +76,6 @@ public class SlotsPage : BaseLayout
|
|||
.Take(ServerStatics.PageSize)
|
||||
.ToListAsync();
|
||||
|
||||
this.SlotCount = this.Slots.Count;
|
||||
|
||||
return this.Page();
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue