From d998fc528b69e9a17a05cf96085b940a113d8f83 Mon Sep 17 00:00:00 2001 From: sunguangming Date: Wed, 6 Nov 2024 09:04:20 +0000 Subject: [PATCH] * [task#131935,done,0.2h] add taskID to path. --- module/task/model.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/module/task/model.php b/module/task/model.php index a65c533298..2a4d9044ce 100755 --- a/module/task/model.php +++ b/module/task/model.php @@ -959,6 +959,10 @@ class taskModel extends model $this->updateParent($task, false); unset($task->id); } + else + { + $this->dao->update(TABLE_TASK)->set('path')->eq(",$taskID,")->where('id')->eq($taskID)->exec(); + } /* Insert task desc data. */ $taskSpec = new stdclass(); @@ -3207,7 +3211,7 @@ class taskModel extends model public function updateParent(object $task, bool $isParentChanged): void { $parentTask = $this->fetchByID((int)$task->parent); - $path = $parentTask ? $parentTask->path . $task->id . ',' : ',' . $task->id . ','; + $path = $parentTask->path . $task->id . ','; $this->dao->update(TABLE_TASK)->set('path')->eq($path)->where('id')->eq($task->id)->exec(); if(!$parentTask->isParent) $this->dao->update(TABLE_TASK)->set('isParent')->eq(1)->where('id')->eq((int)$task->parent)->exec();