From 7891bf8591057a794e9b90d3d10bcaf7b52f8074 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Wed, 25 Jul 2018 11:05:36 +0800 Subject: [PATCH] * fix bug #1440. --- module/task/control.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/module/task/control.php b/module/task/control.php index 2019d920b1..2087ab5d96 100644 --- a/module/task/control.php +++ b/module/task/control.php @@ -1289,8 +1289,10 @@ class task extends control if(!$this->session->taskWithChildren) { $children = $this->dao->select('*')->from(TABLE_TASK)->where('deleted')->eq(0) - ->andWhere('parent')->in(array_keys($tasks)) - ->beginIF($this->post->exportType == 'selected')->andWhere('id')->in($this->cookie->checkedItem)->fi() + ->andWhere('parent')->ne(0) + ->andWhere('parent', true)->in(array_keys($tasks)) + ->beginIF($this->post->exportType == 'selected')->orWhere('id')->in($this->cookie->checkedItem)->fi() + ->markRight(1) ->orderBy($sort) ->fetchGroup('parent', 'id'); if(!empty($children)) @@ -1324,8 +1326,13 @@ class task extends control { array_splice($tasks, $position, 0, $children[$task->id]); $position += count($children[$task->id]); + unset($children[$task->id]); } } + if($children) + { + foreach($children as $childTasks) $tasks += $childTasks; + } } }