Revert for query

This commit is contained in:
David Bomba 2023-06-16 14:44:43 +10:00
parent 97fbe491d9
commit 06edbe3f06

View File

@ -95,7 +95,7 @@ class EmailStatementService
EmailStatement::THIS_YEAR => [now()->startOfDay()->firstOfYear()->format('Y-m-d'), now()->startOfDay()->lastOfYear()->format('Y-m-d')], EmailStatement::THIS_YEAR => [now()->startOfDay()->firstOfYear()->format('Y-m-d'), now()->startOfDay()->lastOfYear()->format('Y-m-d')],
EmailStatement::LAST_YEAR => [now()->startOfDay()->subYearNoOverflow()->firstOfYear()->format('Y-m-d'), now()->startOfDay()->subYearNoOverflow()->lastOfYear()->format('Y-m-d')], EmailStatement::LAST_YEAR => [now()->startOfDay()->subYearNoOverflow()->firstOfYear()->format('Y-m-d'), now()->startOfDay()->subYearNoOverflow()->lastOfYear()->format('Y-m-d')],
EmailStatement::ALL_TIME => [ EmailStatement::ALL_TIME => [
Invoice::withTrashed()->where('client_id', $client->id)->selectRaw('MIN(invoices.date) as start_date')->pluck('start_date')->first() $client->invoices()->selectRaw('MIN(invoices.date) as start_date')->pluck('start_date')->first()
?: Carbon::now()->format('Y-m-d'), ?: Carbon::now()->format('Y-m-d'),
Carbon::now()->format('Y-m-d') Carbon::now()->format('Y-m-d')
], ],