* [done#133222,doing,0.5h] add delay tip in project::execution.

This commit is contained in:
liumengyi
2024-12-03 13:25:42 +08:00
committed by 田淑杰
parent 0fc9a67f98
commit f95e5fe8f4
2 changed files with 16 additions and 1 deletions
+15
View File
@@ -794,6 +794,21 @@ class programplanModel extends model
{
$tasks = $this->dao->select('*')->from(TABLE_TASK)->where('deleted')->eq(0)->andWhere('project')->eq($projectID)->andWhere('execution')->in($planIdList)->orderBy('execution_asc, order_asc, id_desc')->fetchAll('id');
}
$today = helper::today();
foreach($tasks as $taskID => $task)
{
/* Delayed or not?. */
if(!empty($task->deadline) and !helper::isZeroDate($task->deadline))
{
$endDate = $today;
if(($task->status == 'done' || $task->status == 'closed') && !helper::isZeroDate($task->finishedDate)) $endDate = substr($task->finishedDate, 0, 10);
$actualDays = $this->loadModel('holiday')->getActualWorkingDays($task->deadline, $endDate);
$delay = count($actualDays) - 1;
if($delay > 0) $tasks[$taskID]->delay = $delay;
}
}
return $tasks;
}
}