From e5ce9156b4d2eb66a921e5302c13234ec2ac020b Mon Sep 17 00:00:00 2001 From: Wahyu Ramadhan Date: Mon, 12 Jun 2023 13:33:32 +0700 Subject: [PATCH] Fix jobs done --- app/Models/Activity.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/Models/Activity.php b/app/Models/Activity.php index ce49289..29ab815 100644 --- a/app/Models/Activity.php +++ b/app/Models/Activity.php @@ -188,6 +188,8 @@ class Activity extends Model return 0; if(!$dataPlan = AssignMaterial::where('activity_id', $this->id)->get()) return 0; + if($dataPlan->isEmpty()) + return 0; if($dataPlan[0]->status_activity == 'done') return 100; return $this->persentase_progress;