From 756543f132cba4f614ec159a864e539dbb56c5dc Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 22 Jun 2021 18:46:46 +1000 Subject: [PATCH] Change query parameter when querying datetimes --- app/Jobs/Cron/RecurringInvoicesCron.php | 4 ++-- app/Jobs/Util/ReminderJob.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Jobs/Cron/RecurringInvoicesCron.php b/app/Jobs/Cron/RecurringInvoicesCron.php index 21df692fde..cfb0d71266 100644 --- a/app/Jobs/Cron/RecurringInvoicesCron.php +++ b/app/Jobs/Cron/RecurringInvoicesCron.php @@ -43,7 +43,7 @@ class RecurringInvoicesCron nlog("Sending recurring invoices ".Carbon::now()->format('Y-m-d h:i:s')); if (! config('ninja.db.multi_db_enabled')) { - $recurring_invoices = RecurringInvoice::whereDate('next_send_date', '<=', now()->toDateTimeString()) + $recurring_invoices = RecurringInvoice::where('next_send_date', '<=', now()->toDateTimeString()) ->whereNotNull('next_send_date') ->where('status_id', RecurringInvoice::STATUS_ACTIVE) ->where('remaining_cycles', '!=', '0') @@ -64,7 +64,7 @@ class RecurringInvoicesCron foreach (MultiDB::$dbs as $db) { MultiDB::setDB($db); - $recurring_invoices = RecurringInvoice::whereDate('next_send_date', '<=', now()->toDateTimeString()) + $recurring_invoices = RecurringInvoice::where('next_send_date', '<=', now()->toDateTimeString()) ->whereNotNull('next_send_date') ->where('status_id', RecurringInvoice::STATUS_ACTIVE) ->where('remaining_cycles', '!=', '0') diff --git a/app/Jobs/Util/ReminderJob.php b/app/Jobs/Util/ReminderJob.php index 7704940a94..9bc48a6340 100644 --- a/app/Jobs/Util/ReminderJob.php +++ b/app/Jobs/Util/ReminderJob.php @@ -55,7 +55,7 @@ class ReminderJob implements ShouldQueue { nlog("Sending invoice reminders " . now()->format('Y-m-d h:i:s')); - Invoice::whereDate('next_send_date', '<=', now()->toDateTimeString()) + Invoice::where('next_send_date', '<=', now()->toDateTimeString()) ->where('is_deleted', 0) ->whereIn('status_id', [Invoice::STATUS_SENT, Invoice::STATUS_PARTIAL]) ->where('balance', '>', 0)