summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2021-11-19 14:28:37 +0800
committerGitHub <noreply@github.com>2021-11-19 14:28:37 +0800
commit6f3596e33cb2e8a6a33124184887b234de59a94c (patch)
treeb18b63d78f81d7fc20b89134ece58fb35c97a1f6 /models
parent0305a7363341e8a52c71b99f0abfb81a75ead150 (diff)
downloadgitea-6f3596e33cb2e8a6a33124184887b234de59a94c.tar.gz
gitea-6f3596e33cb2e8a6a33124184887b234de59a94c.zip
Fix bug when project board get open issue number (#17703) (#17726)
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Diffstat (limited to 'models')
-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 e35307158d..b5b3a6492c 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
}