1
0
mirror of https://github.com/muety/wakapi.git synced 2023-08-10 21:12:56 +03:00

refctor: change active users query

This commit is contained in:
Ferdinand Mütsch
2021-02-13 11:23:58 +01:00
parent 6b0b3bddda
commit daf67b844a
12 changed files with 430 additions and 358 deletions

View File

@ -57,9 +57,8 @@ func (srv *UserService) GetAll() ([]*models.User, error) {
}
func (srv *UserService) GetActive() ([]*models.User, error) {
// a user is considered active if she has logged in to the web interface at least once within the last x days
minDate := time.Now().Add(-24 * time.Hour * time.Duration(srv.Config.App.InactiveDays))
return srv.repository.GetByLoggedInAfter(minDate)
return srv.repository.GetByLastActiveAfter(minDate)
}
func (srv *UserService) Count() (int64, error) {