From fe47c0600a5d1daf0e9ce03364698f7257d7bd9b Mon Sep 17 00:00:00 2001 From: Yagami <976204163@qq.com> Date: Wed, 9 Oct 2019 16:49:09 +0800 Subject: [PATCH] * Finish task #6381. --- module/task/model.php | 1 + 1 file changed, 1 insertion(+) diff --git a/module/task/model.php b/module/task/model.php index 565eedc1f5..7bd9bf250d 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -413,6 +413,7 @@ class taskModel extends model if($parentID <= 0) return true; $oldParentTask = $this->dao->select('*')->from(TABLE_TASK)->where('id')->eq($parentID)->fetch(); + if($oldParentTask->parent != '-1') $this->dao->update(TABLE_TASK)->set('parent')->eq('-1')->where('id')->eq($parentID)->exec(); $this->computeWorkingHours($parentID); $childrenStatus = $this->dao->select('id,status')->from(TABLE_TASK)->where('parent')->eq($parentID)->andWhere('deleted')->eq(0)->fetchPairs('status', 'status');