From 7bd8b727aecc2e01f3ef3fc051b1554c4bf2b2e8 Mon Sep 17 00:00:00 2001 From: Wahyu Ramadhan Date: Thu, 20 Jul 2023 08:53:04 +0700 Subject: [PATCH] Fix lag --- app/Http/Controllers/ActivityController.php | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/app/Http/Controllers/ActivityController.php b/app/Http/Controllers/ActivityController.php index f3c172d..126fc02 100644 --- a/app/Http/Controllers/ActivityController.php +++ b/app/Http/Controllers/ActivityController.php @@ -251,17 +251,6 @@ class ActivityController extends Controller $updateBobot = true; if(!$data = Activity::find($id)) return response()->json(['status'=>'failed', 'action'=>'error','message'=>'Data not found!','code'=> 404], 404); - $link = Link::where('t_activity_id', $data->id)->get(); - if ($link) { - foreach ($link as $linkData) { - $predecessor = Activity::find($linkData->s_activity_id); - $start = new DateTime($data->start_date); - $end = new DateTime($predecessor->end_date); - $lag = $start->diff($end)->format('%a'); - $linkData->lag = $lag; - $linkData->save(); - } - } $dataUpdate = $request->all(); $dataUpdate['name'] = $request->text;