From 6f3596e33cb2e8a6a33124184887b234de59a94c Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Fri, 19 Nov 2021 14:28:37 +0800 Subject: [PATCH] Fix bug when project board get open issue number (#17703) (#17726) Co-authored-by: wxiaoguang Co-authored-by: techknowlogick Co-authored-by: wxiaoguang Co-authored-by: techknowlogick --- models/project_issue.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/models/project_issue.go b/models/project_issue.go index e35307158..b5b3a6492 100644 --- a/models/project_issue.go +++ b/models/project_issue.go @@ -115,7 +115,9 @@ func (p *Project) NumClosedIssues() int { func (p *Project) NumOpenIssues() int { c, err := x.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 }