diff --git a/app/Exports/V2/BaseExportFormSubmission.php b/app/Exports/V2/BaseExportFormSubmission.php index cdffec825..7749fde20 100644 --- a/app/Exports/V2/BaseExportFormSubmission.php +++ b/app/Exports/V2/BaseExportFormSubmission.php @@ -85,6 +85,7 @@ protected function getAnswer(array $field, array $answers): string $list[] = 'gender:(' . implode(')(', $types['gender']) . ')'; $list[] = 'age:(' . implode(')(', $types['age']) . ')'; $list[] = 'ethnicity:(' . implode(')(', $types['ethnicity']) . ')'; + return implode('|', $list); case 'leadershipTeam': diff --git a/app/Models/V2/Projects/ProjectReport.php b/app/Models/V2/Projects/ProjectReport.php index ade3fada1..a25f34874 100644 --- a/app/Models/V2/Projects/ProjectReport.php +++ b/app/Models/V2/Projects/ProjectReport.php @@ -192,7 +192,7 @@ class ProjectReport extends Model implements MediaModel, AuditableContract, Repo 'other' => [ Workday::COLLECTION_PROJECT_PAID_OTHER, Workday::COLLECTION_PROJECT_VOLUNTEER_OTHER, - ] + ], ]; public function registerMediaConversions(Media $media = null): void @@ -362,7 +362,8 @@ public function getWorkdaysTotalAttribute(): int } // Assume that the types are balanced and just return the value from 'gender' - $sumTotals = fn ($collectionType) => WorkdayDemographic::whereIn('workday_id', + $sumTotals = fn ($collectionType) => WorkdayDemographic::whereIn( + 'workday_id', Workday::where('workdayable_type', SiteReport::class) ->whereIn('workdayable_id', $this->task->siteReports()->hasBeenSubmitted()->select('id')) ->collections(SiteReport::WORKDAY_COLLECTIONS[$collectionType]) diff --git a/app/Models/V2/Sites/SiteReport.php b/app/Models/V2/Sites/SiteReport.php index d864d3ad9..cbae89591 100644 --- a/app/Models/V2/Sites/SiteReport.php +++ b/app/Models/V2/Sites/SiteReport.php @@ -161,7 +161,7 @@ class SiteReport extends Model implements MediaModel, AuditableContract, ReportM 'other' => [ Workday::COLLECTION_SITE_PAID_OTHER, Workday::COLLECTION_SITE_VOLUNTEER_OTHER, - ] + ], ]; public function registerMediaConversions(Media $media = null): void