Fix filter count

This commit is contained in:
Lunny Xiao authored and Jason Song committed 2022-11-25 17:48:45 +08:00
1 parent 38b36edc5c
commit b65e263f92
4 files changed
+30 -5

No files matched your search

+4
View File
@@ -77,3 +77,7 @@ func FindRuns(ctx context.Context, opts FindRunOptions) (RunList, int64, error)
total, err := e.Desc("id").FindAndCount(&runs)
return runs, total, err
}
func CountRuns(ctx context.Context, opts FindRunOptions) (int64, error) {
return db.GetEngine(ctx).Where(opts.toConds()).Count(new(Run))
}