Fix some queries in postgres store
This commit is contained in:
parent
0fb2871ba1
commit
a5b344277c
@ -90,13 +90,13 @@ func (s *PostgresStore) Stats(statType LoginStats, limit int) ([]StatsResult, er
|
||||
|
||||
switch statType {
|
||||
case LoginStatsCountry:
|
||||
stmt = `select country, count(country) from login_attempts order by count desc`
|
||||
stmt = `select country, count(country) from login_attempts group by country order by count desc`
|
||||
case LoginStatsIP:
|
||||
stmt = `select remote_ip, count(remote_ip) from login_attempts order by count desc`
|
||||
stmt = `select remote_ip, count(remote_ip) from login_attempts group by remote_ip order by count desc`
|
||||
case LoginStatsPasswords:
|
||||
stmt = `select password, count(password) from login_attempts order by count desc`
|
||||
stmt = `select password, count(password) from login_attempts group by password order by count desc`
|
||||
case LoginStatsUsername:
|
||||
stmt = `select username, count(username) from login_attempts order by count desc`
|
||||
stmt = `select username, count(username) from login_attempts group by username order by count desc`
|
||||
}
|
||||
|
||||
if limit > 0 {
|
||||
|
Loading…
Reference in New Issue
Block a user