* [bug#50453,done,0.2h] fix statistic project count issue.

This commit is contained in:
tianshujie
2024-06-03 08:35:45 +08:00
committed by caoyanyi
parent 097d3c1f29
commit b6dcfc07e2
+1 -1
View File
@@ -545,7 +545,7 @@ class productTao extends productModel
/* Get releases count. */
return $this->dao->select('COUNT(*) AS count')->from(TABLE_RELEASE)->where('deleted')->eq('0')->andWhere('product')->eq("$productID")->fetch('count');
case TABLE_PROJECTPRODUCT:
return $this->dao->select('COUNT(*) AS count')
return $this->dao->select('COUNT(DISTINCT(t1.project)) AS count')
->from(TABLE_PROJECTPRODUCT)->alias('t1')
->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id')
->where('t2.deleted')->eq('0')