From 9e6eb11bfd62382a6034283c4c1887a1ad618316 Mon Sep 17 00:00:00 2001 From: Vladimir Hodakov Date: Wed, 24 Jan 2018 12:11:10 +0400 Subject: [PATCH] Fixed forgotten parameter in SQL query --- 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 9c96151..a4fee83 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 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 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