From 73f4a888c5bf94d2fa090d79580f07bb12e773b3 Mon Sep 17 00:00:00 2001 From: Morgan Bazalgette Date: Wed, 9 Aug 2017 23:45:45 +0200 Subject: [PATCH] Allow IN for beatmap_id, beatmapset_id, beatmap_md5 --- app/v1/beatmap.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/v1/beatmap.go b/app/v1/beatmap.go index 7cd8a21..8083b7f 100644 --- a/app/v1/beatmap.go +++ b/app/v1/beatmap.go @@ -129,12 +129,13 @@ func getMultipleBeatmaps(md common.MethodData) common.CodeMessager { Default: "id DESC", Table: "beatmaps", }) + pm := md.Ctx.Request.URI().QueryArgs().PeekMulti where := common. - Where("beatmap_id = ?", md.Query("bb")). - Where("beatmapset_id = ?", md.Query("s")). 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+ where.Clause+" "+sort+" "+