This commit is contained in:
tianshujie
2023-02-16 16:17:48 +08:00
parent 7616c02f17
commit 5e2ac749af
2 changed files with 10 additions and 5 deletions
+8 -3
View File
@@ -2074,12 +2074,17 @@ class executionModel extends model
* Get child executions.
*
* @param int $executionID
* @param string $orderBy
* @access public
* @return void
* @return array
*/
public function getChildExecutions($executionID)
public function getChildExecutions($executionID, $orderBy = 'id_desc')
{
return $this->dao->select('*')->from(TABLE_EXECUTION)->where('deleted')->eq(0)->andWhere('parent')->eq((int)$executionID)->fetchAll('id');
return $this->dao->select('*')->from(TABLE_EXECUTION)
->where('deleted')->eq(0)
->andWhere('parent')->eq((int)$executionID)
->orderBy($orderBy)
->fetchAll('id');
}
/**
+2 -2
View File
@@ -171,8 +171,8 @@ class programplan extends control
$this->view->position[] = html::a($this->createLink('programplan', 'browse', "projectID=$projectID"), $project->name);
$this->view->position[] = $this->lang->programplan->create;
$executions = !empty($planID) ? $this->loadModel('execution')->getChildExecutions($planID) : array();
$plans = $this->programplan->getStage($planID ? $planID : $projectID, $this->productID, 'parent');
$executions = !empty($planID) ? $this->loadModel('execution')->getChildExecutions($planID, 'order_asc') : array();
$plans = $this->programplan->getStage($planID ? $planID : $projectID, $this->productID, 'parent', 'order_asc');
if(!empty($planID) and !empty($plans) and $project->model == 'waterfallplus')
{
$executionType = 'stage';