diff --git a/module/execution/model.php b/module/execution/model.php index 786bed0b96..a338e5da0f 100755 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -1939,11 +1939,14 @@ class executionModel extends model { if(empty($executionIdList)) return array(); - $executionTasks = $this->dao->select('*')->from(TABLE_TASK) - ->where('deleted')->eq(0) - ->beginIF($filterStatus)->andWhere('status')->notin('closed,cancel')->fi() - ->andWhere('execution')->in($executionIdList) - ->orderBy('order_asc') + $fields = "t1.*, t2.id AS storyID, t2.title AS storyTitle, t2.product, t2.branch, t2.version AS latestStoryVersion, t2.status AS storyStatus"; + $executionTasks = $this->dao->select($fields) + ->from(TABLE_TASK)->alias('t1') + ->leftJoin(TABLE_STORY)->alias('t2')->on('t1.story = t2.id') + ->where('t1.deleted')->eq(0) + ->beginIF($filterStatus)->andWhere('t1.status')->notin('closed,cancel')->fi() + ->andWhere('t1.execution')->in($executionIdList) + ->orderBy('t1.order_asc') ->fetchGroup('execution', 'id'); $taskIdList = array(); @@ -4801,6 +4804,14 @@ class executionModel extends model $task->PMAvatar = zget($avatarList, $task->PMAccount, ''); } + $task->needConfirm = false; + if(!empty($task->storyStatus) && $task->storyStatus == 'active' && $task->latestStoryVersion > $task->storyVersion) + { + $task->needConfirm = true; + $task->rawStatus = $task->status; + $task->status = 'changed'; + } + $rows[] = $task; }