diff --git a/module/execution/model.php b/module/execution/model.php index b184cc59d3..4f5cff3583 100755 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -3737,44 +3737,43 @@ class executionModel extends model } /** + * 获取执行的燃尽图数据。 * Get execution burn data. * * @param array $executions * @access public * @return array */ - public function getBurnData($executions) + public function getBurnData(array $executions): array { if(empty($executions)) return array(); /* Get burndown charts datas. */ - $burns = $this->dao->select('execution, date AS name, `left` AS value') + $burnList = $this->dao->select('execution, date AS name, `left` AS value') ->from(TABLE_BURN) ->where('execution')->in(array_keys($executions)) ->andWhere('task')->eq(0) ->orderBy('date desc') ->fetchGroup('execution', 'name'); - foreach($burns as $executionID => $executionBurns) + foreach($burnList as $executionID => $executionBurnList) { - /* If executionBurns > $itemCounts, split it, else call processBurnData() to pad burns. */ - $begin = $executions[$executionID]->begin; - $end = $executions[$executionID]->end; - if(helper::isZeroDate($begin)) $begin = $executions[$executionID]->openedDate; - $executionBurns = $this->processBurnData($executionBurns, $this->config->execution->defaultBurnPeriod, $begin, $end); + /* If executionBurnList > $itemCounts, split it, else call processBurnData() to pad burnList. */ + $begin = helper::isZeroDate($executions[$executionID]->begin) ? $executions[$executionID]->openedDate : $executions[$executionID]->begin; + $executionBurnList = $this->processBurnData($executionBurnList, $this->config->execution->defaultBurnPeriod, $begin, $executions[$executionID]->end); /* Shorter names. */ - foreach($executionBurns as $executionBurn) + foreach($executionBurnList as $executionBurn) { $executionBurn->name = substr($executionBurn->name, 5); unset($executionBurn->execution); } - ksort($executionBurns); - $burns[$executionID] = $executionBurns; + ksort($executionBurnList); + $burnList[$executionID] = $executionBurnList; } - return $burns; + return $burnList; } /** diff --git a/module/execution/test/execution.class.php b/module/execution/test/execution.class.php index a6c65eaac3..21974a0509 100644 --- a/module/execution/test/execution.class.php +++ b/module/execution/test/execution.class.php @@ -1931,13 +1931,14 @@ class executionTest } /** - * Function getBurnData test by execution. + * 获取执行的燃尽图数据。 + * Get execution burn data. * - * @param int $executionID + * @param int $executionID * @access public - * @return int + * @return string|array */ - public function getBurnDataTest($executionID = 0) + public function getBurnDataTest(int $executionID = 0): string|array { $execution = $this->executionModel->getByID($executionID); if(empty($execution)) return '0'; diff --git a/module/execution/test/model/getburndata.php b/module/execution/test/model/getburndata.php index 9b85fd2999..677c8911b2 100644 --- a/module/execution/test/model/getburndata.php +++ b/module/execution/test/model/getburndata.php @@ -38,12 +38,8 @@ $task->gen(10); /** title=测试executionModel->getBurnDataTest(); +timeout=0 cid=1 -pid=1 - -敏捷执行查询统计 >> 36 -瀑布执行查询统计 >> 40.2 -看板执行查询统计 >> 3 */