fix: fetch all tasks for all projects
This commit is contained in:
parent
3b0935d033
commit
353279cbff
@ -10,9 +10,6 @@
|
|||||||
- entity_id: 34
|
- entity_id: 34
|
||||||
user_id: 13 # owner
|
user_id: 13 # owner
|
||||||
kind: 1
|
kind: 1
|
||||||
- entity_id: 34
|
|
||||||
user_id: 1
|
|
||||||
kind: 1
|
|
||||||
- entity_id: 23
|
- entity_id: 23
|
||||||
user_id: 12 # owner
|
user_id: 12 # owner
|
||||||
kind: 2
|
kind: 2
|
||||||
|
@ -401,10 +401,9 @@ func getRawTasksForProjects(s *xorm.Session, projects []*Project, a web.Auth, op
|
|||||||
}
|
}
|
||||||
|
|
||||||
var projectIDCond builder.Cond
|
var projectIDCond builder.Cond
|
||||||
var projectCond builder.Cond
|
var favoritesCond builder.Cond
|
||||||
if len(projectIDs) > 0 {
|
if len(projectIDs) > 0 {
|
||||||
projectIDCond = builder.In("project_id", projectIDs)
|
projectIDCond = builder.In("project_id", projectIDs)
|
||||||
projectCond = projectIDCond
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if hasFavoritesProject {
|
if hasFavoritesProject {
|
||||||
@ -435,7 +434,7 @@ func getRawTasksForProjects(s *xorm.Session, projects []*Project, a web.Auth, op
|
|||||||
builder.Eq{"kind": FavoriteKindTask},
|
builder.Eq{"kind": FavoriteKindTask},
|
||||||
))
|
))
|
||||||
|
|
||||||
projectCond = builder.And(projectCond, builder.And(builder.In("id", favCond), builder.In("project_id", userProjectIDs)))
|
favoritesCond = builder.In("id", favCond)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(reminderFilters) > 0 {
|
if len(reminderFilters) > 0 {
|
||||||
@ -486,7 +485,7 @@ func getRawTasksForProjects(s *xorm.Session, projects []*Project, a web.Auth, op
|
|||||||
}
|
}
|
||||||
|
|
||||||
limit, start := getLimitFromPageIndex(opts.page, opts.perPage)
|
limit, start := getLimitFromPageIndex(opts.page, opts.perPage)
|
||||||
cond := builder.And(projectCond, where, filterCond)
|
cond := builder.And(builder.Or(projectIDCond, favoritesCond), where, filterCond)
|
||||||
|
|
||||||
query := s.Where(cond)
|
query := s.Where(cond)
|
||||||
if limit > 0 {
|
if limit > 0 {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user