Dont included deleted_at items for the status

This commit is contained in:
Deon George 2023-11-24 23:20:38 +11:00
parent e337a29003
commit 82cee02fa8

View File

@ -254,6 +254,7 @@ class HomeController extends Controller
->join('echomails',['echomails.id'=>'echomail_seenby.echomail_id']) ->join('echomails',['echomails.id'=>'echomail_seenby.echomail_id'])
->whereNotNull('export_at') ->whereNotNull('export_at')
->whereNull('sent_at') ->whereNull('sent_at')
->whereNull('echomails.deleted_at')
->where('datetime','<',$date) ->where('datetime','<',$date)
->groupBy('addresses.id'); ->groupBy('addresses.id');
@ -264,6 +265,7 @@ class HomeController extends Controller
->orWhereRaw(sprintf('(flags & %d) > 0',Message::FLAG_LOCAL)); ->orWhereRaw(sprintf('(flags & %d) > 0',Message::FLAG_LOCAL));
}) })
->whereRaw(sprintf('(flags & %d) = 0',Message::FLAG_SENT)) ->whereRaw(sprintf('(flags & %d) = 0',Message::FLAG_SENT))
->whereNull('netmails.deleted_at')
->where('datetime','<',$date) ->where('datetime','<',$date)
->groupBy('addresses.id'); ->groupBy('addresses.id');
@ -272,6 +274,7 @@ class HomeController extends Controller
->join('files',['files.id'=>'file_seenby.file_id']) ->join('files',['files.id'=>'file_seenby.file_id'])
->whereNotNull('export_at') ->whereNotNull('export_at')
->whereNull('sent_at') ->whereNull('sent_at')
->whereNull('files.deleted_at')
->where('datetime','<',$date) ->where('datetime','<',$date)
->groupBy('addresses.id'); ->groupBy('addresses.id');