* Adjust code for task #117451. Batch get data.
This commit is contained in:
@@ -35,23 +35,16 @@ $cols['progress']['sortType'] = false;
|
||||
|
||||
$projectStats = initTableData($projectStats, $cols, $this->project);
|
||||
|
||||
$this->loadModel('story');
|
||||
$waitCount = 0;
|
||||
$doingCount = 0;
|
||||
$suspendedCount = 0;
|
||||
$closedCount = 0;
|
||||
$projectIdList = array_column($projectStats, 'id');
|
||||
$storyGroup = $this->loadModel('story')->fetchStoriesByProjectIdList($projectIdList);
|
||||
$executionGroup = $this->loadModel('execution')->fetchExecutionsByProjectIdList($projectIdList);
|
||||
foreach($projectStats as $project)
|
||||
{
|
||||
if($project->status == 'wait') $waitCount ++;
|
||||
if($project->status == 'doing') $doingCount ++;
|
||||
if($project->status == 'suspended') $suspendedCount ++;
|
||||
if($project->status == 'closed') $closedCount ++;
|
||||
|
||||
$projectStories = $this->story->getExecutionStories($project->id);
|
||||
$projectStories = zget($storyGroup, $project->id, array());
|
||||
$project->storyCount = count($projectStories);
|
||||
$project->storyPoints = round(array_sum(array_column($projectStories, 'estimate')), 2) . ' ' . $this->config->hourUnit;
|
||||
|
||||
$executions = $this->loadModel('execution')->getStatData($project->id, 'all');
|
||||
$executions = zget($executionGroup, $project->id, array());
|
||||
$project->executionCount = count($executions);
|
||||
|
||||
$project = $this->project->formatDataForList($project, $PMList);
|
||||
|
||||
Reference in New Issue
Block a user