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 {
|
switch statType {
|
||||||
case LoginStatsCountry:
|
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:
|
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:
|
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:
|
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 {
|
if limit > 0 {
|
||||||
|
Loading…
Reference in New Issue
Block a user