aboutsummaryrefslogtreecommitdiffstats
path: root/models/issues/pull_list.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/issues/pull_list.go')
-rw-r--r--models/issues/pull_list.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/models/issues/pull_list.go b/models/issues/pull_list.go
index c209386e2e..2ee69cd323 100644
--- a/models/issues/pull_list.go
+++ b/models/issues/pull_list.go
@@ -212,3 +212,12 @@ func HasMergedPullRequestInRepo(ctx context.Context, repoID, posterID int64) (bo
Limit(1).
Get(new(Issue))
}
+
+// GetPullRequestByIssueIDs returns all pull requests by issue ids
+func GetPullRequestByIssueIDs(ctx context.Context, issueIDs []int64) (PullRequestList, error) {
+ prs := make([]*PullRequest, 0, len(issueIDs))
+ return prs, db.GetEngine(ctx).
+ Where("issue_id > 0").
+ In("issue_id", issueIDs).
+ Find(&prs)
+}