Show ZC/RC name instead of system name, tweak FTN sort order

This commit is contained in:
Deon George
2021-06-24 23:09:09 +10:00
parent 25f853cea4
commit e207e0a1d8
3 changed files with 46 additions and 3 deletions

View File

@@ -12,6 +12,17 @@ class Address extends Model
{
use ScopeActive;
/* SCOPES */
public function scopeFTNOrder($query)
{
return $query
->orderBy('region_id')
->orderByRaw('host_id NULLS FIRST')
->orderBy('node_id')
->orderBy('point_id');
}
/* RELATIONS */
public function system()
@@ -101,6 +112,12 @@ class Address extends Model
return ($o && $o->system->active) ? $o : NULL;
}
/**
* Retrieve the address session details/passwords
*
* @param string $type
* @return string|null
*/
public function session(string $type): ?string
{
static $session = NULL;