Fix file sending, as a result of moving $size into Send::class when optimising mail sending

This commit is contained in:
2024-06-21 12:15:22 +10:00
parent 0a5374c743
commit 7bd192980f
4 changed files with 18 additions and 9 deletions

View File

@@ -1043,9 +1043,20 @@ class Address extends Model
*/
public function filesWaiting(): Collection
{
return $this->file_seen()
->whereNull('sent_at')
return File::select('files.*')
->join('file_seenby',['file_seenby.file_id'=>'files.id'])
->where('address_id',$this->id)
->whereNull('files.deleted_at')
->whereNotNull('export_at')
->whereNull('sent_at')
->orderby('id')
->with([
'filearea:id,name,domain_id',
'filearea.domain:id,name',
'fftn:id,zone_id,host_id,node_id,point_id',
'fftn.zone:id,domain_id,zone_id',
'fftn.zone.domain:id,name',
])
->get();
}