* finish task #2313.

This commit is contained in:
wangyidong
2015-08-28 10:54:37 +08:00
parent cc660238a2
commit 91b76c85d8
2 changed files with 14 additions and 1 deletions
+1 -1
View File
@@ -737,7 +737,7 @@ class project extends control
$baselineJSON = '[]';
$firstBurn = empty($sets) ? 0 : reset($sets);
$firstTime = isset($firstBurn->value) ? $firstBurn->value : 0;
$firstTime = isset($firstBurn->value) ? $firstBurn->value : $this->project->getTotalEstimate($projectInfo->id);
$days = count($dateList) - 1;
$rate = round($firstTime / $days, 2);
$baselineJSON = '[';
+13
View File
@@ -1581,4 +1581,17 @@ class projectModel extends model
return array($dateList, $interval);
}
/**
* Get total estimate.
*
* @param int $projectID
* @access public
* @return float
*/
public function getTotalEstimate($projectID)
{
$estimate = $this->dao->select('SUM(estimate) as estimate')->from(TABLE_TASK)->where('deleted')->eq('0')->andWhere('project')->eq($projectID)->fetch('estimate');
return round($estimate);
}
}