* Refactor batchCreate of task.

This commit is contained in:
朱金勇
2023-05-23 03:01:23 +00:00
parent 9e49d9be07
commit 1bd75e6929
7 changed files with 84 additions and 78 deletions
+21 -1
View File
@@ -2144,6 +2144,26 @@ class taskModel extends model
return $this->taskTao->batchComputeProgress($tasks);
}
/**
* Get task list of stories.
*
* @param int[] $storyIdList
* @param int $executionID
* @param int $projectID
* @access public
* @return object[]
*/
public function getListByStories(array $storyIdList, int $executionID = 0, int $projectID = 0): array
{
return $this->dao->select('id, story, parent, name, assignedTo, pri, status, estimate, consumed, closedReason, `left`')
->from(TABLE_TASK)
->where('story')->in($storyIdList)
->andWhere('deleted')->eq(0)
->beginIF($executionID)->andWhere('execution')->eq($executionID)->fi()
->beginIF($projectID)->andWhere('project')->eq($projectID)->fi()
->fetchAll('id');
}
/**
* Get counts of some stories' tasks.
*
@@ -3156,7 +3176,7 @@ class taskModel extends model
echo round($task->progress, 2) . '%';
break;
case 'deadline':
if(substr($task->deadline, 0, 4) > 0) echo '<span>' . substr($task->deadline, 5, 6) . '</span>';
if($task->deadline && substr($task->deadline, 0, 4) > 0) echo '<span>' . substr($task->deadline, 5, 6) . '</span>';
break;
case 'openedBy':
echo zget($users, $task->openedBy);