diff options
Diffstat (limited to 'planetwars-server/src/db/match_queries.rs')
-rw-r--r-- | planetwars-server/src/db/match_queries.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/planetwars-server/src/db/match_queries.rs b/planetwars-server/src/db/match_queries.rs index f9f8140..029a657 100644 --- a/planetwars-server/src/db/match_queries.rs +++ b/planetwars-server/src/db/match_queries.rs @@ -12,6 +12,7 @@ pub struct ListBotMatches { pub outcome: Option<BotMatchOutcome>, pub opponent_id: Option<i32>, + pub map_id: Option<i32>, // pagination options pub before: Option<NaiveDateTime>, @@ -55,6 +56,10 @@ impl QueryFragment<Pg> for ListBotMatches { } out.push_sql(" WHERE matches.state = 'finished' AND matches.is_public = true"); + if let Some(map_id) = self.map_id.as_ref() { + out.push_sql(" AND matches.map_id = "); + out.push_bind_param::<Integer, _>(map_id)?; + } if let Some(outcome) = self.outcome.as_ref() { match outcome { BotMatchOutcome::Win => { |