Compare commits

..

No commits in common. "e65e66479219961d16873d3b3c18a4b254fcb172" and "0a5374c7430da9c378781a6c8f0e5469bc83af41" have entirely different histories.

3 changed files with 9 additions and 25 deletions

View File

@ -41,6 +41,7 @@ final class File extends Send
return $this->f->datetime->timestamp;
case 'name':
case 'size':
return $this->f->{$key};
case 'type':
@ -83,8 +84,6 @@ final class File extends Send
*/
public function open(string $compress=''): bool
{
$this->size = $this->f->size;
// If sending file is a File::class, then our file is s3
if ($this->nameas && $this->f instanceof FileModel) {
$this->fd = Storage::readStream($this->f->rel_name);

View File

@ -43,6 +43,9 @@ final class Tic extends Send
case 'mtime':
return $this->f->datetime->timestamp;
case 'size':
return strlen($this->tic);
case 'type':
return ($this->ftype&0xff00)>>8;
@ -64,8 +67,6 @@ final class Tic extends Send
public function open(string $compress=''): bool
{
$this->size = strlen($this->tic);
return TRUE;
}

View File

@ -395,8 +395,7 @@ class Address extends Model
*/
public function scopeFTN($query)
{
return $query
->select(['id','addresses.zone_id','host_id','node_id','point_id','system_id'])
return $query->select(['id','addresses.zone_id','host_id','node_id','point_id'])
->with([
'zone:zones.id,domain_id,zone_id',
'zone.domain:domains.id,name',
@ -603,13 +602,9 @@ class Address extends Model
public function nodes_hub(): HasMany
{
return $this->hasMany(Address::class,'hub_id','id')
->select(['id','addresses.zone_id','host_id','node_id','point_id','system_id'])
->FTN()
->active()
->FTNorder()
->with([
'zone:zones.id,domain_id,zone_id',
'zone.domain:domains.id,name',
]);
->FTNorder();
}
/**
@ -1048,20 +1043,9 @@ class Address extends Model
*/
public function filesWaiting(): Collection
{
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')
return $this->file_seen()
->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',
])
->whereNotNull('export_at')
->get();
}