* Add case of execution method.

This commit is contained in:
tianshujie
2023-02-18 20:16:52 +08:00
parent 73077a3615
commit b05cad4add
3 changed files with 85 additions and 1 deletions
+40
View File
@@ -2806,4 +2806,44 @@ class executionTest
->andWhere('date')->eq($date)
->orderBy('date DESC, id asc')->fetchGroup('name', 'date');
}
/**
* Reset execution sorts.
*
* @param int $projectID
* @param string $type noParent
* @access public
* @return string
*/
public function resetExecutionSortsTest($projectID, $type = '')
{
$executions = array();
$executionIDList = '';
$firstGradeExecutions = array();
if($projectID)
{
$executions = $this->executionModel->dao->select('*')->from(TABLE_EXECUTION)
->where('deleted')->eq(0)
->andWhere('project')->eq($projectID)
->andWhere('type')->in('sprint,stage,kanban')
->orderBy('order_asc')
->fetchAll('id');
if($type == 'hasParent')
{
foreach($executions as $execution)
{
if($execution->grade == 1) $firstGradeExecutions[$execution->id] = $execution->id;
}
}
}
$executions = $this->executionModel->resetExecutionSorts($executions, $firstGradeExecutions);
if(!empty($executions))
{
$executionIDList = array_keys($executions);
$executionIDList = implode(',', $executionIDList);
}
return $executionIDList;
}
}