From 1757b9ab9da0f226ddaae7ebe44710fa00af83de Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Fri, 18 Nov 2022 10:16:31 +0800 Subject: [PATCH] * Fix bug#29969. --- module/report/model.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/module/report/model.php b/module/report/model.php index 4e2f16bb0f..b6ff30b900 100644 --- a/module/report/model.php +++ b/module/report/model.php @@ -726,6 +726,7 @@ class reportModel extends model ->orWhere('RD')->in($accounts) ->markRight(1) ->fi() + ->andWhere('shadow')->eq(0) ->fetchAll('id'); /* Get created plans in this year. */ @@ -733,6 +734,7 @@ class reportModel extends model ->leftJoin(TABLE_ACTION)->alias('t2')->on("t1.id=t2.objectID and t2.objectType='productplan'") ->where('LEFT(t2.date, 4)')->eq($year) ->andWhere('t1.deleted')->eq(0) + ->andWhere('t1.product')->in(array_keys($products)) ->beginIF($accounts) ->andWhere('t2.actor')->in($accounts) ->fi() @@ -750,11 +752,13 @@ class reportModel extends model $createStoryProducts = $this->dao->select('DISTINCT product')->from(TABLE_STORY) ->where('LEFT(openedDate, 4)')->eq($year) ->andWhere('deleted')->eq(0) + ->andWhere('product')->in(array_keys($products)) ->beginIF($accounts)->andWhere('openedBy')->in($accounts)->fi() ->fetchPairs('product', 'product'); $closeStoryProducts = $this->dao->select('DISTINCT product')->from(TABLE_STORY) ->where('LEFT(closedDate, 4)')->eq($year) ->andWhere('deleted')->eq(0) + ->andWhere('product')->in(array_keys($products)) ->beginIF($accounts)->andWhere('closedBy')->in($accounts)->fi() ->fetchPairs('product', 'product'); if($createStoryProducts or $closeStoryProducts)