|
|
@ -120,7 +120,6 @@ class Activity extends Model |
|
|
|
|
|
|
|
|
|
|
|
private function updatePersentaseProgress() |
|
|
|
private function updatePersentaseProgress() |
|
|
|
{ |
|
|
|
{ |
|
|
|
print_r(2); |
|
|
|
|
|
|
|
if($parent = Activity::find($this->parent_id)){ |
|
|
|
if($parent = Activity::find($this->parent_id)){ |
|
|
|
$parentActWeight = $parent->bobot_planning; |
|
|
|
$parentActWeight = $parent->bobot_planning; |
|
|
|
|
|
|
|
|
|
|
@ -131,11 +130,9 @@ class Activity extends Model |
|
|
|
$currentActProportionalProgress = ($currentActWeight / $parentActWeight) * $child->persentase_progress; |
|
|
|
$currentActProportionalProgress = ($currentActWeight / $parentActWeight) * $child->persentase_progress; |
|
|
|
$totalChildProportionalProgress += $currentActProportionalProgress; |
|
|
|
$totalChildProportionalProgress += $currentActProportionalProgress; |
|
|
|
} |
|
|
|
} |
|
|
|
print_r($totalChildProportionalProgress); |
|
|
|
$parent->update([ |
|
|
|
$x = $parent->update([ |
|
|
|
|
|
|
|
"persentase_progress" => $totalChildProportionalProgress |
|
|
|
"persentase_progress" => $totalChildProportionalProgress |
|
|
|
]); |
|
|
|
]); |
|
|
|
print_r($x); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|