summaryrefslogtreecommitdiffstats
path: root/models/issue.go
diff options
context:
space:
mode:
authorUnknown <joe2010xtmf@163.com>2014-03-27 16:31:32 -0400
committerUnknown <joe2010xtmf@163.com>2014-03-27 16:31:32 -0400
commit34f4af9ebf179dbb24a7da6091b4259d66a3c426 (patch)
tree41be4b8840f28b03dd12551d6403cd459b9ced10 /models/issue.go
parentf76eb8a6662dd705f4c59fd59e583a315a1900d2 (diff)
downloadgitea-34f4af9ebf179dbb24a7da6091b4259d66a3c426.tar.gz
gitea-34f4af9ebf179dbb24a7da6091b4259d66a3c426.zip
Working on issue and install page
Diffstat (limited to 'models/issue.go')
-rw-r--r--models/issue.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/models/issue.go b/models/issue.go
index b05667c3a8..b30676e940 100644
--- a/models/issue.go
+++ b/models/issue.go
@@ -136,6 +136,12 @@ func GetIssues(userId, repoId, posterId, milestoneId int64, page int, isClosed,
return issues, err
}
+// GetUserIssueCount returns the number of issues that were created by given user in repository.
+func GetUserIssueCount(userId, repoId int64) int64 {
+ count, _ := orm.Where("poster_id=?", userId).And("repo_id=?", repoId).Count(new(Issue))
+ return count
+}
+
// UpdateIssue updates information of issue.
func UpdateIssue(issue *Issue) error {
_, err := orm.Id(issue.Id).AllCols().Update(issue)