|
|
@ -57,14 +57,13 @@ func (r *taskRepository) ListWithLinks(ctx context.Context, filter models.TaskFi |
|
|
|
sq = sq.Where(squirrel.Eq{"task.item_id": filter.ItemIDs}) |
|
|
|
} |
|
|
|
if filter.ProjectIDs != nil { |
|
|
|
sq = sq.LeftJoin("task_link AS tl ON task.task_id = tl.task_id") |
|
|
|
|
|
|
|
sq = sq.Where(squirrel.Or{ |
|
|
|
squirrel.Eq{"task.project_id": filter.ProjectIDs}, |
|
|
|
squirrel.Eq{"tl.project_id": filter.ProjectIDs}, |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
sq = sq.LeftJoin("task_link AS tl ON task.task_id = tl.task_id") |
|
|
|
sq = sq.InnerJoin("project AS p ON task.project_id = p.project_id") |
|
|
|
sq = sq.OrderBy("active DESC", "status_tag ASC", "created_time") |
|
|
|
|
|
|
|