Andrew Wallo 9 months ago
parent
commit
3adff9e169
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      app/Services/AccountService.php

+ 2
- 2
app/Services/AccountService.php View File

381
         $driver = DB::getDriverName();
381
         $driver = DB::getDriverName();
382
 
382
 
383
         $datediff = $driver === 'pgsql'
383
         $datediff = $driver === 'pgsql'
384
-            ? "DATE_PART('day', ?::date - invoices.due_date)"
384
+            ? '(?::date - invoices.due_date::date)'
385
             : 'DATEDIFF(?, invoices.due_date)';
385
             : 'DATEDIFF(?, invoices.due_date)';
386
 
386
 
387
         return Invoice::query()
387
         return Invoice::query()
404
         $driver = DB::getDriverName();
404
         $driver = DB::getDriverName();
405
 
405
 
406
         $datediff = $driver === 'pgsql'
406
         $datediff = $driver === 'pgsql'
407
-            ? "DATE_PART('day', ?::date - bills.due_date)"
407
+            ? '(?::date - bills.due_date::date)'
408
             : 'DATEDIFF(?, bills.due_date)';
408
             : 'DATEDIFF(?, bills.due_date)';
409
 
409
 
410
         return Bill::query()
410
         return Bill::query()

Loading…
Cancel
Save