Sort node's AKAs, fix Host selection for new addresses

This commit is contained in:
Deon George 2021-08-15 16:41:04 +10:00
parent 655c0db94d
commit 988d4dda52
2 changed files with 2 additions and 2 deletions

View File

@ -66,7 +66,7 @@ class DomainController extends Controller
{ {
$oo = Address::where('role',self::NODE_NC) $oo = Address::where('role',self::NODE_NC)
->where('zone_id',$o->id) ->where('zone_id',$o->id)
->when($region,function($query,$region) { return $query->where('region_id',$region)->where('node_id','<>',0); }) ->when($region,function($query,$region) { return $query->where('region_id',$region)->where('node_id',0); })
->when((! $region),function($query) use ($region) { return $query->where('region_id',0); }) ->when((! $region),function($query) use ($region) { return $query->where('region_id',0); })
->where('point_id',0) ->where('point_id',0)
->FTNorder() ->FTNorder()

View File

@ -169,7 +169,7 @@ use App\Http\Controllers\DomainController as DC;
</thead> </thead>
<tbody> <tbody>
@foreach ($o->addresses->sortBy(['region_id','host_id']) as $oo) @foreach ($o->addresses->sortBy(function($item) { return sprintf('%04x%04x%04x%04x%04x',$item->zone->zone_id,$item->region_id,$item->host_id,$item->node_id,$item->point_id); }) as $oo)
<tr> <tr>
<td>{{ $oo->ftn }}</td> <td>{{ $oo->ftn }}</td>
<td>{{ $oo->active ? 'YES' : 'NO' }}</td> <td>{{ $oo->active ? 'YES' : 'NO' }}</td>