From 42d3a970720b89b4bfc27678a2e9faf707aef74c Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Fri, 21 Nov 2025 20:01:01 +0100 Subject: [PATCH] wait #7821 @1 --- .../Commands/HemsleyAuditCollection.php | 34 +++++++++++++++++++ app/Console/Kernel.php | 1 + 2 files changed, 35 insertions(+) create mode 100644 app/Console/Commands/HemsleyAuditCollection.php diff --git a/app/Console/Commands/HemsleyAuditCollection.php b/app/Console/Commands/HemsleyAuditCollection.php new file mode 100644 index 000000000..f4a5d41b3 --- /dev/null +++ b/app/Console/Commands/HemsleyAuditCollection.php @@ -0,0 +1,34 @@ +publications; + $existing = []; + foreach ($publications as $publication) { + $existing[$publication['fluidbook']] = true; + } + $fluidbooks = \App\Models\FluidbookPublication::where('created_at', '>', '2025-11-21 00:00:00')->where('invoicable_company', 1880)->where('c_title', 'like', 'Hemsley Fraser%')->orderBy('id', 'DESC')->get(); + foreach ($fluidbooks as $fb) { + if (isset($existing[$fb->id])) { + continue; + } + $id = $fb->id; + $publications[] = [ + 'fluidbook' => "$id", + 'export' => '', + 'dir' => '' + ]; + $existing[$id] = true; + } + $collection->update(['publications' => json_encode($publications)]); + } +} diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index b03bb93ee..d0e6d215c 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -45,6 +45,7 @@ class Kernel extends \Cubist\Backpack\Console\Kernel // Mailjet $schedule->command('job:dispatchNow ListmonkSyncList')->dailyAt('5:00'); // Link audit + $schedule->command('hemsleyfraser:auditcollection')->dailyAt('23:00'); $schedule->command('job:dispatchNow AuditLinkRegister')->dailyAt('0:30'); $schedule->command('job:dispatchNow AuditLink')->dailyAt('1:00'); } -- 2.39.5