From 677f3d5c89d02ea1b6d914430568cd27517bf9ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arthur=20Parient=C3=A9?= <41431456+arthurpar06@users.noreply.github.com> Date: Mon, 20 May 2024 00:20:19 +0200 Subject: [PATCH] Map LastPirepID in Legacy PirepImporter (#1809) --- 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; }