diff options
Diffstat (limited to 'models/review.go')
-rw-r--r-- | models/review.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/models/review.go b/models/review.go index acb54d970f..1ffff8feb6 100644 --- a/models/review.go +++ b/models/review.go @@ -208,6 +208,11 @@ func FindReviews(opts FindReviewOptions) ([]*Review, error) { return findReviews(x, opts) } +// CountReviews returns count of reviews passing FindReviewOptions +func CountReviews(opts FindReviewOptions) (int64, error) { + return x.Where(opts.toCond()).Count(&Review{}) +} + // CreateReviewOptions represent the options to create a review. Type, Issue and Reviewer are required. type CreateReviewOptions struct { Content string |