Skip to content

Commit

Permalink
fixes reminders being sent unnecessarily
Browse files Browse the repository at this point in the history
  • Loading branch information
florence-77 committed Nov 15, 2023
1 parent 3375520 commit 09e204f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/Jobs/SendReminders.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ public function handle()
->whereDoesntHave('reminder', function ($query) {
$query->whereDate('sent_at', now());
})
->whereHas('site', function ($query) {
$query->whereYear('last_measured_at', '<', now()->year);
$query->orWhere('last_measured_at', '<', now()->subDays(31));
})
->with(['reminder'])
->cursor();

Expand Down

0 comments on commit 09e204f

Please sign in to comment.