From fccd603b38fbfd2482927f710a49e2e915ee7865 Mon Sep 17 00:00:00 2001 From: Arthur Pariente Date: Sun, 19 May 2024 22:34:31 +0200 Subject: [PATCH] Map LastPirepID in Legacy PirepImporter --- app/Services/LegacyImporter/PirepImporter.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/Services/LegacyImporter/PirepImporter.php b/app/Services/LegacyImporter/PirepImporter.php index 174fa7625..b9ecd11bc 100644 --- a/app/Services/LegacyImporter/PirepImporter.php +++ b/app/Services/LegacyImporter/PirepImporter.php @@ -136,6 +136,12 @@ public function run($start = 0) $count++; } + if ($pirep->user && $pirep->state === PirepState::ACCEPTED) { + $pirep->user->update([ + 'last_pirep_id' => $pirep->id, + ]); + } + if (!$pirep->airline || !$pirep->airline->journal) { continue; }