* Fix bug#15988.

This commit is contained in:
xieqiyu
2022-04-14 15:12:44 +08:00
parent 15a9c5a9b2
commit 778bc369ea
+5 -3
View File
@@ -218,12 +218,14 @@ class projectModel extends model
->groupBy('root')
->fetchAll('root');
$estimates = $this->dao->select('t2.parent as project, sum(estimate) as estimate')->from(TABLE_TASK)->alias('t1')
$condition = $this->config->systemMode == 'classic' ? 't2.id as project' : 't2.parent as project';
$estimates = $this->dao->select("$condition, sum(estimate) as estimate")->from(TABLE_TASK)->alias('t1')
->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.execution = t2.id')
->where('t2.parent')->in($projectIdList)
->where('t1.parent')->lt(1)
->beginIF($this->config->systemMode == 'new')->andWhere('t2.parent')->in($projectIdList)->fi()
->beginIF($this->config->systemMode == 'classic')->andWhere('t2.id')->in($projectIdList)->fi()
->andWhere('t1.deleted')->eq(0)
->andWhere('t2.deleted')->eq(0)
->andWhere('t1.parent')->lt(1)
->groupBy('project')
->fetchAll('project');