diff --git a/app/Http/Resources/V2/ProjectReports/ProjectReportResource.php b/app/Http/Resources/V2/ProjectReports/ProjectReportResource.php index 8d63ce40..c3900005 100644 --- a/app/Http/Resources/V2/ProjectReports/ProjectReportResource.php +++ b/app/Http/Resources/V2/ProjectReports/ProjectReportResource.php @@ -118,8 +118,8 @@ public function toArray($request) 'people_knowledge_skills_increased' => $this->people_knowledge_skills_increased, 'indirect_beneficiaries' => $this->indirect_beneficiaries, 'indirect_beneficiaries_description' => $this->indirect_beneficiaries_description, - 'workdays_direct_total' => $this->workdays_direct, - 'workdays_convergence_total' => $this->workdays_convergence, + 'workdays_direct_total' => $this->workdays_direct_total, + 'workdays_convergence_total' => $this->workdays_convergence_total, 'non_tree_total' => $this->non_tree_total, 'total_community_partners' => $this->total_community_partners, ]; diff --git a/app/Models/Traits/HasWorkdays.php b/app/Models/Traits/HasWorkdays.php index ec97f8b4..8e88a0c4 100644 --- a/app/Models/Traits/HasWorkdays.php +++ b/app/Models/Traits/HasWorkdays.php @@ -42,12 +42,12 @@ public function getWorkdaysVolunteerAttribute(): int return $this->sumTotalWorkdaysAmounts(self::WORKDAY_COLLECTIONS['volunteer']); } - public function getWorkdaysDirectAttribute(): int + public function getWorkdaysDirectTotalAttribute(): int { return $this->sumTotalWorkdaysAmounts(self::WORKDAY_COLLECTIONS['direct']); } - public function getWorkdaysConvergenceAttribute(): int + public function getWorkdaysConvergenceTotalAttribute(): int { return $this->sumTotalWorkdaysAmounts(self::WORKDAY_COLLECTIONS['convergence']); } diff --git a/app/Models/Traits/UsesLinkedFields.php b/app/Models/Traits/UsesLinkedFields.php index f76a6dff..68be03d2 100644 --- a/app/Models/Traits/UsesLinkedFields.php +++ b/app/Models/Traits/UsesLinkedFields.php @@ -225,7 +225,7 @@ private function mapValue($model, string $property, array $linkedFieldInfo) if (empty($resource)) { return $model->$relation; } - if (empty($model->$relation) || ! is_iterable($model->$relation)) { + if (empty($model->$relation)) { return []; }