From 4239c2f0e96daed546f680ba29ef7d6e579c4d2e Mon Sep 17 00:00:00 2001 From: Howl Date: Tue, 25 Oct 2016 20:03:33 +0200 Subject: [PATCH] Add mods to get_scores --- app/peppy/score.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/peppy/score.go b/app/peppy/score.go index c2e581b..42f0f78 100644 --- a/app/peppy/score.go +++ b/app/peppy/score.go @@ -43,6 +43,7 @@ func GetScores(c *gin.Context, db *sqlx.DB) { extraWhere = "AND " + w extraParams = append(extraParams, p) } + mods := common.Int(c.Query("mods")) rows, err := db.Query(` SELECT scores.id, scores.score, users.username, scores.300_count, scores.100_count, @@ -55,9 +56,10 @@ WHERE scores.completed = '3' AND users.privileges & 1 > 0 AND scores.beatmap_md5 = ? AND scores.play_mode = ? + AND scores.mods & ? = ? `+extraWhere+` ORDER BY `+sb+` DESC LIMIT `+strconv.Itoa(common.InString(1, c.Query("limit"), 100, 50)), - append([]interface{}{beatmapMD5, genmodei(c.Query("m"))}, extraParams...)...) + append([]interface{}{beatmapMD5, genmodei(c.Query("m")), mods, mods}, extraParams...)...) if err != nil { c.Error(err) c.JSON(200, defaultResponse)