This commit is contained in:
tianshujie
2024-04-29 14:12:02 +08:00
parent c5c30fd1e8
commit a8710ffd65
3 changed files with 10 additions and 21 deletions
+1 -1
View File
@@ -1341,8 +1341,8 @@ class programModel extends model
->where('t1.`date`')->ge($updateTime)
->andWhere('t1.project')->ne(0)
->fetchAll('project');
if(empty($projects)) return;
}
if(empty($projects)) return;
/* 1. Refresh stats to db. */
$this->programTao->updateStats(array_keys($projects));
+3 -2
View File
@@ -336,10 +336,11 @@ class programTao extends programModel
*/
protected function setNoTaskExecution(array $projectIdList): array
{
$summary = array();
$summary = array();
$executionGroup = $this->dao->select('id, project')->from(TABLE_PROJECT)->where('project')->in($projectIdList)->andWhere('deleted')->eq(0)->fetchGroup('project', 'id');
foreach($projectIdList as $projectID)
{
$executions = $this->dao->select('id')->from(TABLE_PROJECT)->where('project')->eq($projectID)->andWhere('deleted')->eq(0)->fetchPairs();
$executions = zget($executionGroup, $projectID, array());
foreach($executions as $executionID)
{
$taskCount = $this->dao->select('id')->from(TABLE_TASK)
+6 -18
View File
@@ -34,18 +34,6 @@ if($project->grade > 1)
);
}
$totalEstimate = $workhour->totalConsumed + $workhour->totalLeft;
$progress = 0;
if($project->model == 'waterfall')
{
$progressList = $this->project->getWaterfallProgress(array($project->id));
$progress = empty($progressList[$project->id]) ? 0 : $progressList[$project->id];
}
elseif($totalEstimate > 0)
{
$progress = floor($workhour->totalConsumed / $totalEstimate * 1000) / 1000 * 100;
}
$status = $this->processStatus('project', $project);
$relatedProducts = null;
@@ -184,13 +172,13 @@ row
'radius' => array('80%', '90%'),
'itemStyle' => array('borderRadius' => '40'),
'label' => array('show' => false),
'data' => array($progress, 100 - $progress)
'data' => array($project->progress, 100 - $project->progress)
)))
),
div
(
set::className('pie-chart-title text-center'),
div(span(set::className('text-2xl font-bold'), $progress . '%')),
div(span(set::className('text-2xl font-bold'), $project->progress . '%')),
div
(
span
@@ -461,19 +449,19 @@ row
(
setClass('w-1/3'),
span(setClass('text-gray'), $lang->execution->estimateHours),
span(setClass('ml-2'), (float)$workhour->totalEstimate . 'h')
span(setClass('ml-2'), (float)$project->estimate . 'h')
),
div
(
setClass('w-1/3'),
span(setClass('text-gray'), $lang->execution->consumedHours),
span(setClass('ml-2'), (float)$workhour->totalConsumed . 'h')
span(setClass('ml-2'), (float)$project->consumed . 'h')
),
div
(
setClass('w-1/3'),
span(setClass('text-gray'), $lang->execution->leftHours),
span(setClass('ml-2'), (float)$workhour->totalLeft . 'h')
span(setClass('ml-2'), (float)$project->left . 'h')
),
div
(
@@ -485,7 +473,7 @@ row
(
setClass('w-1/3 mt-4'),
span(setClass('text-gray'), $lang->execution->totalHours),
span(setClass('ml-2'), (float)$workhour->totalLeft . 'h')
span(setClass('ml-2'), (float)$project->left . 'h')
),
div
(