forked from forgejo/forgejo
Add member
, collaborator
, contributor
, and first-time contributor
roles and tooltips (#26658)
GitHub like role descriptor    --------- Co-authored-by: delvh <dev.lh@web.de> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
parent
0d55f64e6c
commit
d2e4039def
5 changed files with 106 additions and 73 deletions
|
@ -199,3 +199,16 @@ func (prs PullRequestList) GetIssueIDs() []int64 {
|
|||
}
|
||||
return issueIDs
|
||||
}
|
||||
|
||||
// HasMergedPullRequestInRepo returns whether the user(poster) has merged pull-request in the repo
|
||||
func HasMergedPullRequestInRepo(ctx context.Context, repoID, posterID int64) (bool, error) {
|
||||
return db.GetEngine(ctx).
|
||||
Join("INNER", "pull_request", "pull_request.issue_id = issue.id").
|
||||
Where("repo_id=?", repoID).
|
||||
And("poster_id=?", posterID).
|
||||
And("is_pull=?", true).
|
||||
And("pull_request.has_merged=?", true).
|
||||
Select("issue.id").
|
||||
Limit(1).
|
||||
Get(new(Issue))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue