From 497bcdb57432eab3c8a5957c42dc72cf3becb3b1 Mon Sep 17 00:00:00 2001 From: zenggang Date: Fri, 17 Sep 2021 11:11:36 +0800 Subject: [PATCH] * Fix bug#14490 --- module/product/model.php | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/module/product/model.php b/module/product/model.php index 3c11df1a76..6ee8c03633 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -958,13 +958,24 @@ class productModel extends model $emptyHour = array('totalEstimate' => 0, 'totalConsumed' => 0, 'totalLeft' => 0, 'progress' => 0); /* Get all tasks and compute totalEstimate, totalConsumed, totalLeft, progress according to them. */ - $tasks = $this->dao->select('id, project, estimate, consumed, `left`, status, closedReason') - ->from(TABLE_TASK) - ->where('project')->in($projectKeys) - ->andWhere('parent')->lt(1) - ->andWhere('deleted')->eq(0) - ->fetchGroup('project', 'id'); - + if($this->config->systemMode == 'new') + { + $tasks = $this->dao->select('id, project, estimate, consumed, `left`, status, closedReason') + ->from(TABLE_TASK) + ->where('project')->in($projectKeys) + ->andWhere('parent')->lt(1) + ->andWhere('deleted')->eq(0) + ->fetchGroup('project', 'id'); + } + else + { + $tasks = $this->dao->select('id, execution, estimate, consumed, `left`, status, closedReason') + ->from(TABLE_TASK) + ->where('execution')->in($projectKeys) + ->andWhere('parent')->lt(1) + ->andWhere('deleted')->eq(0) + ->fetchGroup('execution', 'id'); + } /* Compute totalEstimate, totalConsumed, totalLeft. */ foreach($tasks as $projectID => $projectTasks) {