+ [task#130250,start,0.5h] add taskModel::getLinkedBugsByTaskID.

This commit is contained in:
liumengyi
2024-10-23 09:18:10 +08:00
committed by 刘刚
parent a6a3f0618e
commit da3b869be7
+18
View File
@@ -2166,4 +2166,22 @@ class bugModel extends model
->andWhere('t3.id')->ne('')
->fetchGroup('revision', 'id');
}
/**
* 通过任务ID获取相关的Bug
* @param int $taskID
*
* @access public
* @return array|false
*/
public function getLinkedBugsByTaskID(int $taskID): array|false
{
return $this->dao->select('t1.id,t1.title')
->from(TABLE_BUG)->alias('t1')
->leftJoin(TABLE_TASK)->alias('t2')->on('t1.task=t2.id')
->where('t2.id')->eq($taskID)
->andWhere('t1.deleted')->eq(0)
->andWhere('t2.deleted')->eq(0)
->fetchAll('id');
}
}