Added file areas and TIC processing
This commit is contained in:
@@ -159,7 +159,29 @@ class Address extends Model
|
||||
public function echomails()
|
||||
{
|
||||
return $this->belongsToMany(Echomail::class,'echomail_seenby')
|
||||
->withPivot(['sent_at','packet']);
|
||||
->withPivot(['sent_at','export_at','packet']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Files that this address has seen
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
*/
|
||||
public function files()
|
||||
{
|
||||
return $this->belongsToMany(File::class,'file_seenby')
|
||||
->withPivot(['sent_at','export_at']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Echoareas this address is subscribed to
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
*/
|
||||
public function fileareas()
|
||||
{
|
||||
return $this->belongsToMany(Filearea::class)
|
||||
->withPivot(['subscribed']);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -409,7 +431,7 @@ class Address extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Netmail waiting to be sent to this system
|
||||
* Echomail waiting to be sent to this system
|
||||
*
|
||||
* @return Collection
|
||||
*/
|
||||
@@ -421,6 +443,19 @@ class Address extends Model
|
||||
->get();
|
||||
}
|
||||
|
||||
/**
|
||||
* Files waiting to be sent to this system
|
||||
*
|
||||
* @return Collection
|
||||
*/
|
||||
public function filesWaiting(): Collection
|
||||
{
|
||||
return $this->files()
|
||||
->whereNull('file_seenby.sent_at')
|
||||
->whereNotNull('file_seenby.export_at')
|
||||
->get();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get echomail for this node
|
||||
*
|
||||
|
Reference in New Issue
Block a user