Use created_at not datetime on status, since datetime may be wrong by the sender

This commit is contained in:
Deon George 2023-11-25 09:29:08 +11:00
parent a13497df5f
commit 4070a060c3

View File

@ -255,7 +255,7 @@ class HomeController extends Controller
->whereNotNull('export_at') ->whereNotNull('export_at')
->whereNull('sent_at') ->whereNull('sent_at')
->whereNull('echomails.deleted_at') ->whereNull('echomails.deleted_at')
->where('datetime','<',$date) ->where('echomails.created_at','<',$date)
->groupBy('addresses.id'); ->groupBy('addresses.id');
$n = Address::select(['addresses.id',DB::raw('0 as e'),DB::raw('count(*) as n'),DB::raw('0 as f')]) $n = Address::select(['addresses.id',DB::raw('0 as e'),DB::raw('count(*) as n'),DB::raw('0 as f')])
@ -266,7 +266,7 @@ class HomeController extends Controller
}) })
->whereRaw(sprintf('(flags & %d) = 0',Message::FLAG_SENT)) ->whereRaw(sprintf('(flags & %d) = 0',Message::FLAG_SENT))
->whereNull('netmails.deleted_at') ->whereNull('netmails.deleted_at')
->where('datetime','<',$date) ->where('netmails.created_at','<',$date)
->groupBy('addresses.id'); ->groupBy('addresses.id');
$f = Address::select(['addresses.id',DB::raw('0 as e'),DB::raw('0 as n'),DB::raw('count(*) as f')]) $f = Address::select(['addresses.id',DB::raw('0 as e'),DB::raw('0 as n'),DB::raw('count(*) as f')])
@ -275,7 +275,7 @@ class HomeController extends Controller
->whereNotNull('export_at') ->whereNotNull('export_at')
->whereNull('sent_at') ->whereNull('sent_at')
->whereNull('files.deleted_at') ->whereNull('files.deleted_at')
->where('datetime','<',$date) ->where('files.created_at','<',$date)
->groupBy('addresses.id'); ->groupBy('addresses.id');
$r = Address::select([ $r = Address::select([