+ show the total working hour state.

This commit is contained in:
wangchunsheng
2009-10-30 06:45:26 +00:00
parent 88f22c48a5
commit da878ee457
4 changed files with 26 additions and 17 deletions
+6 -1
View File
@@ -99,7 +99,12 @@ class projectModel extends model
/* 通过Id获取项目信息。*/
public function findById($projectID)
{
return $this->dao->findById((int)$projectID)->from(TABLE_PROJECT)->fetch();
$project = $this->dao->findById((int)$projectID)->from(TABLE_PROJECT)->fetch();
$total = $this->dao->select('SUM(estimate) AS totalEstimate, SUM(consumed) AS totalConsumed, SUM(`left`) AS totalLeft')->from(TABLE_TASK)->where('project')->eq((int)$projectID)->fetch();
$project->totalEstimate = $total->totalEstimate;
$project->totalConsumed = $total->totalConsumed;
$project->totalLeft = $total->totalLeft;
return $project;
}
/* 获得相关的产品列表。*/