This commit is contained in:
wangyidong
2018-07-25 11:05:36 +08:00
parent b74da6e419
commit 7891bf8591
+9 -2
View File
@@ -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;
}
}
}