This commit is contained in:
Howl 2016-05-28 20:31:46 +02:00
parent 571325e98f
commit fb08a80308
1 changed files with 8 additions and 2 deletions

View File

@ -25,7 +25,7 @@ func GetUserBest(c *gin.Context, db *sql.DB) {
} else {
sb = "scores.score"
}
getUserX(c, db, "ORDER BY "+sb+" DESC", common.InString(1, c.Query("limit"), 100, 10))
getUserX(c, db, "AND completed = '3' ORDER BY "+sb+" DESC", common.InString(1, c.Query("limit"), 100, 10))
}
func getUserX(c *gin.Context, db *sql.DB, orderBy string, limit int) {
@ -59,9 +59,10 @@ func getUserX(c *gin.Context, db *sql.DB, orderBy string, limit int) {
acc float64
fc bool
mods int
bid *int
)
err := rows.Scan(
&curscore.BeatmapID, &curscore.Score.Score, &curscore.MaxCombo,
&bid, &curscore.Score.Score, &curscore.MaxCombo,
&curscore.Count300, &curscore.Count100, &curscore.Count50,
&curscore.CountGeki, &curscore.CountKatu, &curscore.CountMiss,
&fc, &mods, &curscore.UserID, &rawTime,
@ -72,6 +73,11 @@ func getUserX(c *gin.Context, db *sql.DB, orderBy string, limit int) {
c.Error(err)
return
}
if bid == nil {
curscore.BeatmapID = 0
} else {
curscore.BeatmapID = *bid
}
curscore.FullCombo = osuapi.OsuBool(fc)
curscore.Mods = osuapi.Mods(mods)
t, err := time.Parse(common.OsuTimeFormat, rawTime)