From c11db58e30f1ba74e06925c823d5486113efdfe9 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Sat, 12 Oct 2024 17:03:05 +0800 Subject: [PATCH] + [task#130251,start,0.5h] get child tasks. --- module/task/model.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/module/task/model.php b/module/task/model.php index 1b19538402..9ae64a600d 100755 --- a/module/task/model.php +++ b/module/task/model.php @@ -3366,4 +3366,19 @@ class taskModel extends model if(is_array($execution)) return $this->dao->select('id,execution')->from(TABLE_TASK)->where('execution')->in($execution)->andWhere('status')->ne('closed')->andWhere('deleted')->eq('0')->fetchGroup('execution'); return $this->dao->select('id,name')->from(TABLE_TASK)->where('execution')->eq($execution)->andWhere('status')->ne('closed')->andWhere('deleted')->eq('0')->fetchPairs(); } + + /** + * 获取子任务 + * Get child tasks + * + * @param array $taskIdList + * @access public + * @return array|false + */ + public function getChildTasksByList(array $taskIdList): array|false + { + $childTasks = $this->dao->select('id,parent')->from(TABLE_TASK)->where('parent')->in($taskIdList)->andWhere('deleted')->eq('0')->fetchGroup('parent', 'id'); + $nonStoryChildTasks = $this->dao->select('id,parent')->from(TABLE_TASK)->where('parent')->in($taskIdList)->andWhere('story')->eq('0')->andWhere('deleted')->eq('0')->fetchGroup('parent', 'id'); + return array($childTasks, $nonStoryChildTasks); + } }