fixed match average rank including unranked players on /matches
This commit is contained in:
2
main.go
2
main.go
@@ -738,7 +738,7 @@ func getMatches(w http.ResponseWriter, r *http.Request) {
|
|||||||
MatchID uint64 `json:"match_stats"`
|
MatchID uint64 `json:"match_stats"`
|
||||||
}
|
}
|
||||||
|
|
||||||
err := iMatch.QueryStats().GroupBy(matchplayer.MatchesColumn).Aggregate(ent.Mean(matchplayer.FieldRankOld)).Scan(context.Background(), &v)
|
err := iMatch.QueryStats().Where(matchplayer.RankOldNEQ(0)).GroupBy(matchplayer.MatchesColumn).Aggregate(ent.Mean(matchplayer.FieldRankOld)).Scan(context.Background(), &v)
|
||||||
if err != nil || len(v) == 0 {
|
if err != nil || len(v) == 0 {
|
||||||
log.Errorf("[GMS] Unable to calc avg rank for match %d: %v", iMatch.ID, err)
|
log.Errorf("[GMS] Unable to calc avg rank for match %d: %v", iMatch.ID, err)
|
||||||
w.WriteHeader(http.StatusInternalServerError)
|
w.WriteHeader(http.StatusInternalServerError)
|
||||||
|
Reference in New Issue
Block a user