Allow IN for beatmap_id, beatmapset_id, beatmap_md5

This commit is contained in:
Morgan Bazalgette 2017-08-09 23:45:45 +02:00
parent b7c00722de
commit 73f4a888c5
No known key found for this signature in database
GPG Key ID: 40D328300D245DA5

View File

@ -129,12 +129,13 @@ func getMultipleBeatmaps(md common.MethodData) common.CodeMessager {
Default: "id DESC", Default: "id DESC",
Table: "beatmaps", Table: "beatmaps",
}) })
pm := md.Ctx.Request.URI().QueryArgs().PeekMulti
where := common. where := common.
Where("beatmap_id = ?", md.Query("bb")).
Where("beatmapset_id = ?", md.Query("s")).
Where("song_name = ?", md.Query("song_name")). Where("song_name = ?", md.Query("song_name")).
Where("beatmap_md5 = ?", md.Query("md5")). Where("ranked_status_freezed = ?", md.Query("ranked_status_frozen"), "0", "1").
Where("ranked_status_freezed = ?", md.Query("ranked_status_frozen"), "0", "1") In("beatmap_id", pm("bb")...).
In("beatmapset_id", pm("s")...).
In("beatmap_md5", pm("md5")...)
rows, err := md.DB.Query(baseBeatmapSelect+ rows, err := md.DB.Query(baseBeatmapSelect+
where.Clause+" "+sort+" "+ where.Clause+" "+sort+" "+