fix(tasks): sql for overdue reminders

This commit is contained in:
kolaente 2022-12-23 18:55:57 +01:00
parent 2940eae1aa
commit e4f841cf6a
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 3 additions and 3 deletions

View File

@ -37,9 +37,9 @@ func getUndoneOverdueTasks(s *xorm.Session, now time.Time) (usersWithTasks map[i
var tasks []*Task
err = s.
Where("due_date is not null AND due_date < ? AND lists.is_archived = false AND namespaces.is_archived = false", nextMinute.Add(time.Hour*14).Format(dbTimeFormat)).
Join("LEFT", "lists", "lists.id = tasks.list_id").
Join("LEFT", "namespaces", "lists.namespace_id = namespaces.id").
Where("due_date is not null AND due_date < ? AND projects.is_archived = false AND namespaces.is_archived = false", nextMinute.Add(time.Hour*14).Format(dbTimeFormat)).
Join("LEFT", "projects", "projects.id = tasks.project_id").
Join("LEFT", "namespaces", "projects.namespace_id = namespaces.id").
And("done = false").
Find(&tasks)
if err != nil {