Archived
1

Fixed forgotten parameter in SQL query

This commit is contained in:
Vladimir Hodakov 2018-01-24 12:11:10 +04:00
parent b7379013a8
commit 9e6eb11bfd

View File

@ -50,7 +50,7 @@ func (u *Users) getUsersWithProfiles() ([]dbmapping.PlayerProfile, bool) {
func (u *Users) findUsersByLevel(levelID int) ([]dbmapping.ProfileWithAddons, bool) { func (u *Users) findUsersByLevel(levelID int) ([]dbmapping.ProfileWithAddons, bool) {
selectedUsers := []dbmapping.ProfileWithAddons{} 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 { if err != nil {
c.Log.Error(err.Error()) c.Log.Error(err.Error())
return selectedUsers, false return selectedUsers, false