* Finish task#54192,54196

This commit is contained in:
zenggang
2022-05-17 07:46:52 +00:00
parent 930f625c7e
commit 8a06d71cfd
4 changed files with 37 additions and 12 deletions
+7 -9
View File
@@ -2008,17 +2008,15 @@ class executionModel extends model
*/
public function getTasks2Imported($toExecution, $branches)
{
$products = $this->loadModel('product')->getProducts($toExecution);
if(empty($products)) return array();
$execution = $this->getById($toExecution);
$project = $this->loadModel('project')->getById($execution->project);
$brotherProjects = $this->project->getBrotherProjects($project);
$executions = $this->dao->select('id')->from(TABLE_EXECUTION)
->where('project')->in(array_keys($brotherProjects))
->andWhere('status')->ne('closed')
->fetchPairs('id');
$execution = $this->getById($toExecution);
$executions = $this->dao->select('t1.product, t1.project')->from(TABLE_PROJECTPRODUCT)->alias('t1')
->leftJoin(TABLE_EXECUTION)->alias('t2')->on('t1.project=t2.id')
->where('t1.product')->in(array_keys($products))
->andWhere('t2.project')->eq($execution->project)
->fetchGroup('project');
$branches = str_replace(',', "','", $branches);
$tasks = $this->dao->select('t1.*, t2.id AS storyID, t2.title AS storyTitle, t2.version AS latestStoryVersion, t2.status AS storyStatus, t3.realname AS assignedToRealName')->from(TABLE_TASK)->alias('t1')
->leftJoin(TABLE_STORY)->alias('t2')->on('t1.story = t2.id')
->leftJoin(TABLE_USER)->alias('t3')->on('t1.assignedTo = t3.account')