From b9e4c4215b93430f645280bff9b0fa17bf0bcfca Mon Sep 17 00:00:00 2001 From: qixinzhi Date: Fri, 24 May 2024 08:50:36 +0000 Subject: [PATCH] * Fix duplicate data. --- module/bi/config/pivots.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/module/bi/config/pivots.php b/module/bi/config/pivots.php index 70ea3c24e2..e5ec53c68a 100644 --- a/module/bi/config/pivots.php +++ b/module/bi/config/pivots.php @@ -1628,7 +1628,7 @@ from ( 0 as userlogin, 0 as consumed, sum(case when t1.action = 'opened' then 1 else 0 end) as storyopen, - sum(case when t1.action = 'closed' and t2.status = 'closed' then 1 else 0 end) as storyclose, + count(distinct case when t1.action = 'closed' and t2.status = 'closed' then t2.id else 0 end) - 1 as storyclose, 0 as taskopen, 0 as taskfinish, 0 as bugopen, @@ -1646,7 +1646,7 @@ from ( 0 as storyopen, 0 as storyclose, sum(case when t1.action = 'opened' then 1 else 0 end) as taskopen, - sum(case when t1.action = 'finished' and t2.status in ('done', 'closed') then 1 else 0 end) as taskfinish, + count(distinct case when t1.action = 'finished' and t2.status in ('done', 'closed') then t2.id else 0 end) - 1 as taskfinish, 0 as bugopen, 0 as bugresolve, 0 as actions @@ -1664,7 +1664,7 @@ from ( 0 as taskopen, 0 as taskfinish, sum(case when t1.action = 'opened' then 1 else 0 end) as bugopen, - sum(case when t1.action = 'resolved' and t2.status in ('resolved', 'closed') then 1 else 0 end) as bugresolve, + count(distinct case when t1.action = 'resolved' and t2.status in ('resolved', 'closed') then t2.id else 0 end) - 1 as bugresolve, 0 as actions from zt_action t1 left join zt_bug t2 on t1.objectID = t2.id