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