aboutsummaryrefslogtreecommitdiffstats
path: root/models/issue.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2017-08-30 12:31:33 +0800
committerLauris BH <lauris@nix.lv>2017-08-30 07:31:33 +0300
commit5de94a67cf09ae21254269058d86f71fe05ea243 (patch)
treec513645ae0024ccec3d93bd1466315fce473cf80 /models/issue.go
parentedc817a1dcb5a65fceb9d2da17288b6c4ce18147 (diff)
downloadgitea-5de94a67cf09ae21254269058d86f71fe05ea243.tar.gz
gitea-5de94a67cf09ae21254269058d86f71fe05ea243.zip
some refactors for issue and comments (#2419)
Diffstat (limited to 'models/issue.go')
-rw-r--r--models/issue.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/models/issue.go b/models/issue.go
index 32e6a5b66b..8723dda913 100644
--- a/models/issue.go
+++ b/models/issue.go
@@ -1206,8 +1206,12 @@ func Issues(opts *IssuesOptions) ([]*Issue, error) {
// GetParticipantsByIssueID returns all users who are participated in comments of an issue.
func GetParticipantsByIssueID(issueID int64) ([]*User, error) {
+ return getParticipantsByIssueID(x, issueID)
+}
+
+func getParticipantsByIssueID(e Engine, issueID int64) ([]*User, error) {
userIDs := make([]int64, 0, 5)
- if err := x.Table("comment").Cols("poster_id").
+ if err := e.Table("comment").Cols("poster_id").
Where("issue_id = ?", issueID).
And("type = ?", CommentTypeComment).
Distinct("poster_id").
@@ -1219,7 +1223,7 @@ func GetParticipantsByIssueID(issueID int64) ([]*User, error) {
}
users := make([]*User, 0, len(userIDs))
- return users, x.In("id", userIDs).Find(&users)
+ return users, e.In("id", userIDs).Find(&users)
}
// UpdateIssueMentions extracts mentioned people from content and