|
@@ -29,13 +29,11 @@ class ProjectGanttService
|
|
}
|
|
}
|
|
|
|
|
|
$treeTasks = make_tree($groupTasks[$groupKey]->toArray());
|
|
$treeTasks = make_tree($groupTasks[$groupKey]->toArray());
|
|
-
|
|
|
|
$groupUniqueKey = uniqid();
|
|
$groupUniqueKey = uniqid();
|
|
$items[] = $this->topGroupFormat(
|
|
$items[] = $this->topGroupFormat(
|
|
$groupUniqueKey,
|
|
$groupUniqueKey,
|
|
isset($groupNamesKeyBy[$groupKey]) ? $groupNamesKeyBy[$groupKey]['name'] : "Empty"
|
|
isset($groupNamesKeyBy[$groupKey]) ? $groupNamesKeyBy[$groupKey]['name'] : "Empty"
|
|
);
|
|
);
|
|
-
|
|
|
|
$tasks = $this->flattenTasks($treeTasks);
|
|
$tasks = $this->flattenTasks($treeTasks);
|
|
|
|
|
|
foreach ($tasks as $task) {
|
|
foreach ($tasks as $task) {
|
|
@@ -55,6 +53,7 @@ class ProjectGanttService
|
|
'start_date' => null,
|
|
'start_date' => null,
|
|
'duration' => null,
|
|
'duration' => null,
|
|
'progress' => 0,
|
|
'progress' => 0,
|
|
|
|
+ 'assign_to' => null,
|
|
'open' => true,
|
|
'open' => true,
|
|
];
|
|
];
|
|
}
|
|
}
|
|
@@ -83,6 +82,7 @@ class ProjectGanttService
|
|
'start_date' => $task['begin'],
|
|
'start_date' => $task['begin'],
|
|
'duration' => $end->diffInDays($begin),
|
|
'duration' => $end->diffInDays($begin),
|
|
'progress' => $progress,
|
|
'progress' => $progress,
|
|
|
|
+ 'assign_to' =>$task['assign']?User::query()->where('id',$task['assign'])->first()->name:null,
|
|
'open' => true,
|
|
'open' => true,
|
|
];
|
|
];
|
|
}
|
|
}
|