From 4327d541e21bdbc6db32c120e981d20eb97cfcf9 Mon Sep 17 00:00:00 2001 From: dingguodong Date: Fri, 25 Aug 2023 13:54:23 +0800 Subject: [PATCH] * Compute progress only without changing task object. --- module/task/tao.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/module/task/tao.php b/module/task/tao.php index 78713ad0c7..03e3c15f32 100644 --- a/module/task/tao.php +++ b/module/task/tao.php @@ -329,7 +329,11 @@ class taskTao extends taskModel $childrenStatus = array(); /* 有的任务对象不是通过taskModel::getByID获取的(比如执行的任务列表),因此可能没有children,需要重新获取它的子任务。*/ - if(!isset($task->children)) $task->children = $this->dao->select('*')->from(TABLE_TASK)->where('parent')->eq($task->id)->fetchAll('id'); + if(!isset($task->children)) + { + $task = clone $task; + $task->children = $this->dao->select('*')->from(TABLE_TASK)->where('parent')->eq($task->id)->fetchAll('id'); + } foreach($task->children as $childTask) {