|
|
@ -4,6 +4,7 @@ namespace App\Http\Controllers; |
|
|
|
|
|
|
|
|
|
|
|
use Illuminate\Http\Request; |
|
|
|
use Illuminate\Http\Request; |
|
|
|
use App\Models\HierarchyFtth; |
|
|
|
use App\Models\HierarchyFtth; |
|
|
|
|
|
|
|
use App\Models\VersionGantt; |
|
|
|
|
|
|
|
|
|
|
|
class HierarchyFtthController extends Controller |
|
|
|
class HierarchyFtthController extends Controller |
|
|
|
{ |
|
|
|
{ |
|
|
@ -115,7 +116,12 @@ class HierarchyFtthController extends Controller |
|
|
|
{ |
|
|
|
{ |
|
|
|
$finalData = []; |
|
|
|
$finalData = []; |
|
|
|
$data = HierarchyFtth::where('project_id', $project_id)->where('parent_id', $parent_id)->orderByRaw('id ASC')->get(); |
|
|
|
$data = HierarchyFtth::where('project_id', $project_id)->where('parent_id', $parent_id)->orderByRaw('id ASC')->get(); |
|
|
|
|
|
|
|
|
|
|
|
foreach($data as $objRow){ |
|
|
|
foreach($data as $objRow){ |
|
|
|
|
|
|
|
if (VersionGantt::where('hierarchy_ftth_id', $objRow->id)->exists()) { |
|
|
|
|
|
|
|
$dataGantt = VersionGantt::where('hierarchy_ftth_id', $objRow->id)->get(); |
|
|
|
|
|
|
|
$objRow->dataGantt = $dataGantt; |
|
|
|
|
|
|
|
} |
|
|
|
$objRow->key = rand(1, 1000); |
|
|
|
$objRow->key = rand(1, 1000); |
|
|
|
$objRow->children = $this->getChildren($project_id, $objRow->id); |
|
|
|
$objRow->children = $this->getChildren($project_id, $objRow->id); |
|
|
|
$finalData[] = $objRow; |
|
|
|
$finalData[] = $objRow; |
|
|
|