aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2021-11-19 12:00:18 +0800
committerGitHub <noreply@github.com>2021-11-19 12:00:18 +0800
commit9361b65f542671457ed09c35ddde9d09ee06d136 (patch)
tree98e0ffd2348af0b2ab267270d8bf6c4edad09408
parent96ec656cf152a3663476bd26a410a13b993e6bac (diff)
downloadgitea-9361b65f542671457ed09c35ddde9d09ee06d136.tar.gz
gitea-9361b65f542671457ed09c35ddde9d09ee06d136.zip
Fix bug when project board get open issue number (#17703)
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
-rw-r--r--models/project_issue.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/models/project_issue.go b/models/project_issue.go
index a3179507dc..4e3bc0039d 100644
--- a/models/project_issue.go
+++ b/models/project_issue.go
@@ -121,7 +121,9 @@ func (p *Project) NumClosedIssues() int {
func (p *Project) NumOpenIssues() int {
c, err := db.GetEngine(db.DefaultContext).Table("project_issue").
Join("INNER", "issue", "project_issue.issue_id=issue.id").
- Where("project_issue.project_id=? AND issue.is_closed=?", p.ID, false).Count("issue.id")
+ Where("project_issue.project_id=? AND issue.is_closed=?", p.ID, false).
+ Cols("issue_id").
+ Count()
if err != nil {
return 0
}