1
1
mirror of https://github.com/go-gitea/gitea synced 2025-09-28 03:28:13 +00:00

Fix filter count

This commit is contained in:
Lunny Xiao
2022-10-19 22:39:50 +08:00
committed by Jason Song
parent 38b36edc5c
commit b65e263f92
4 changed files with 30 additions and 5 deletions

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))
}