Browse Source

bugfix sum up

pull/3/head
Muhammad Sulaiman Yusuf 2 years ago
parent
commit
dcb365cee1
  1. 5
      app/Models/Activity.php

5
app/Models/Activity.php

@ -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);
} }
} }

Loading…
Cancel
Save