+ [task#130253,start,0.3h] add task::getUnclosedTasksByExecution.

This commit is contained in:
liumengyi
2024-10-23 09:18:10 +08:00
committed by 刘刚
parent 4c42e02f90
commit 1301753134
+14
View File
@@ -3352,4 +3352,18 @@ class taskModel extends model
->andWhere('t3.id')->ne('')
->fetchGroup('revision', 'id');
}
/**
* 获取执行未关闭的任务
* Get unclosed tasks by execution
*
* @param string|int $execution
* @access public
* @return array|false
*/
public function getUnclosedTasksByExecution(array|int $execution): array|false
{
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();
}
}