From 074fc4a1e34ae5ec3fcb37c4d1da854bc25c65f9 Mon Sep 17 00:00:00 2001 From: Vladimir Hodakov Date: Wed, 24 Jan 2018 12:20:00 +0400 Subject: [PATCH] Final fix for forgotten SQL filter --- lib/users/users.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/users/users.go b/lib/users/users.go index a4fee83..b98ee47 100644 --- a/lib/users/users.go +++ b/lib/users/users.go @@ -50,7 +50,7 @@ func (u *Users) getUsersWithProfiles() ([]dbmapping.PlayerProfile, bool) { func (u *Users) findUsersByLevel(levelID int) ([]dbmapping.ProfileWithAddons, bool) { selectedUsers := []dbmapping.ProfileWithAddons{} - err := c.Db.Select(&selectedUsers, c.Db.Rebind("SELECT p.*, l.symbol AS league_symbol, l.id AS league_id, pl.telegram_id FROM players pl, profiles p, leagues l WHERE pl.id = p.player_id AND p.created_at > NOW() - INTERVAL 72 HOUR AND p.level_id = ? GROUP BY player_id"), levelID) + err := c.Db.Select(&selectedUsers, c.Db.Rebind("SELECT p.*, l.symbol AS league_symbol, l.id AS league_id, pl.telegram_id FROM players pl, profiles p, leagues l WHERE pl.id = p.player_id AND l.id = pl.league_id AND p.created_at > NOW() - INTERVAL 72 HOUR AND p.level_id = ? GROUP BY player_id"), levelID) if err != nil { c.Log.Error(err.Error()) return selectedUsers, false