* [task#144207,done,0.2h] Use the computeDelay method to get the delay days.

This commit is contained in:
tianshujie
2025-05-29 10:10:14 +08:00
committed by 刘梦艺
parent 7692e7fa8a
commit d4409fbd4e
2 changed files with 2 additions and 23 deletions
+1 -11
View File
@@ -2009,17 +2009,7 @@ class executionModel extends model
/* Delayed or not?. */
$isNotCancel = !in_array($task->status, array('cancel', 'closed')) || ($task->status == 'closed' && !helper::isZeroDate($task->finishedDate) && $task->closedReason != 'cancel');
$isComputeDelay = !helper::isZeroDate($task->deadline) && $isNotCancel;
if($isComputeDelay)
{
$endDate = helper::isZeroDate($task->finishedDate) ? $today : $task->finishedDate;
$betweenDays = $this->holiday->getDaysBetween($task->deadline, $endDate);
if($betweenDays)
{
$delayDays = array_intersect($betweenDays, $workingDays);
$delay = count($delayDays) - 1;
if($delay > 0) $task->delay = $delay;
}
}
if($isComputeDelay) $task = $this->task->computeDelay($task, $task->deadline, $workingDays);
/* Story changed or not. */
$task->storyVersion = zget($storyVersionPairs, $task->id, $task->storyVersion);