* [bug#53621,done,1h] Eliminate duplicates of get tasks.

This commit is contained in:
zhouxin
2024-08-09 13:32:12 +08:00
committed by 綦新志
parent fe2e785dfc
commit 5c0fb59dbb
2 changed files with 24 additions and 3 deletions
@@ -20,7 +20,7 @@
*/
class count_of_assigned_task_in_user extends baseCalc
{
public $dataset = 'getTasks';
public $dataset = 'getTasksWithTeam';
public $fieldList = array('t1.id', "case when t1.mode != '' and t4.status != 'done' then t4.account when t1.mode != '' and t4.status = 'done' then '' else t1.assignedTo end as assignedTo", 't1.status', 't1.mode', 't4.account', 't3.status as projectStatus', 't2.status as executionStatus', 't4.status as teamStatus');
+23 -2
View File
@@ -754,7 +754,29 @@ class dataset
}
/**
* 获取项目数据。
* 获取任务数据,包括团队成员。
* Get all tasks data with team.
*
* @param string $fieldList
* @access public
* @return PDOStatement
*/
public function getTasksWithTeam($fieldList)
{
$stmt = $this->dao->select($fieldList)->from(TABLE_TASK)->alias('t1')
->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.execution=t2.id')
->leftJoin(TABLE_PROJECT)->alias('t3')->on('t2.project=t3.id')
->beginIF(strpos($fieldList, 't4') !== false)->leftJoin(TABLE_TASKTEAM)->alias('t4')->on("t1.id=t4.task and t1.mode='multi'")->fi()
->where('t2.type')->in('sprint,kanban,stage')
->andWhere('t1.deleted')->eq('0')
->andWhere('t2.deleted')->eq('0')
->andWhere('t3.deleted')->eq('0');
return $this->defaultWhere($stmt, 't1');
}
/**
* 获取任务数据。
* Get all tasks.
*
* @param string $fieldList
@@ -766,7 +788,6 @@ class dataset
$stmt = $this->dao->select($fieldList)->from(TABLE_TASK)->alias('t1')
->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.execution=t2.id')
->leftJoin(TABLE_PROJECT)->alias('t3')->on('t2.project=t3.id')
->beginIF(strpos($fieldList, 't4') !== false)->leftJoin(TABLE_TASKTEAM)->alias('t4')->on("t1.id=t4.task and t1.mode='multi'")->fi()
->where('t2.type')->in('sprint,kanban,stage')
->andWhere('t1.deleted')->eq('0')
->andWhere('t2.deleted')->eq('0')