From 22df3bf36838ba0b6050e8401bda22b14f495a1c Mon Sep 17 00:00:00 2001 From: sunguangming Date: Fri, 29 Nov 2024 05:25:33 +0000 Subject: [PATCH] * [bug#57567,done,0.2h] fix bug. --- module/task/model.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/module/task/model.php b/module/task/model.php index 39c1ca2842..68ad7f09b7 100755 --- a/module/task/model.php +++ b/module/task/model.php @@ -801,14 +801,15 @@ class taskModel extends model } /* Initialize task data and update it. */ + $parent = $this->fetchById($taskID); + $newTask = array(); - if(!empty($earliestEstStarted)) $newTask['estStarted'] = $earliestEstStarted; - if(!empty($earliestRealStarted)) $newTask['realStarted'] = $earliestRealStarted; - if(!empty($latestDeadline)) $newTask['deadline'] = $latestDeadline; + if(!empty($earliestEstStarted) && $parent->estStarted > $earliestEstStarted) $newTask['estStarted'] = $earliestEstStarted; + if(!empty($earliestRealStarted) && $parent->realStarted > $earliestRealStarted) $newTask['realStarted'] = $earliestRealStarted; + if(!empty($latestDeadline) && $parent->deadline < $latestDeadline) $newTask['deadline'] = $latestDeadline; if(!empty($newTask)) $this->dao->update(TABLE_TASK)->data($newTask)->autoCheck()->where('id')->eq($taskID)->exec(); - $task = $this->fetchById($taskID); - if($task->parent) $this->computeBeginAndEnd($task->parent); + if($parent->parent) $this->computeBeginAndEnd($parent->parent); return !dao::isError(); }