Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions app/Http/Controllers/AnnReportController.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,14 @@ public function mammContExp(): View
foreach ($mammMachines as $m) {
// Get the two most recent survey dates
$recent = $m->testdate->whereIn('type_id', [1, 2])->sortByDesc('test_date')->take(2);
if ($recent->count() == 0) continue; // Machine has no test dates, skip it
if ($recent->count() == 0) {
continue;
} // Machine has no test dates, skip it
$mammDates[$m->description] = [
'location' => $m->location->location,
'date1' => $recent->pop()->test_date,
'date2' => ($recent->count() == 1) ? $recent->pop()->test_date : '',
];
];
}

/**
Expand All @@ -65,12 +67,14 @@ public function mammContExp(): View
foreach ($sbbMachines as $m) {
// Get the two most recent survey dates
$recent = $m->testdate->whereIn('type_id', [1, 2])->sortByDesc('test_date')->take(2);
if ($recent->count() == 0) continue; // Machine has no test dates, skip it.
if ($recent->count() == 0) {
continue;
} // Machine has no test dates, skip it.
$sbbDates[$m->description] = [
'location' => $m->location->location,
'date1' => $recent->pop()->test_date,
'date2' => ($recent->count() == 1) ? $recent->pop()->test_date : '',
];
];
}

return view('ar.cexp', [
Expand Down