From ecbefdb9216877cf247c03faab479ef363db5d89 Mon Sep 17 00:00:00 2001 From: kolaente Date: Sun, 14 Apr 2024 17:21:53 +0200 Subject: [PATCH] fix(buckets): return correct task count for tasks in buckets --- pkg/models/task_search.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/models/task_search.go b/pkg/models/task_search.go index c152ca4e6..8c80735ca 100644 --- a/pkg/models/task_search.go +++ b/pkg/models/task_search.go @@ -297,6 +297,7 @@ func (d *dbTaskSearcher) Search(opts *taskSearchOptions) (tasks []*Task, totalCo queryCount = queryCount.Join("LEFT", "task_buckets", "task_buckets.task_id = tasks.id") } totalCount, err = queryCount. + Select("count(DISTINCT tasks.id)"). Count(&Task{}) return }