DB query performance fixes

This commit is contained in:
Deon George
2021-06-25 23:38:57 +10:00
parent 64215ebcea
commit 17a44a0945
8 changed files with 29 additions and 943 deletions

View File

@@ -41,7 +41,7 @@
<td colspan="5"><a href="{{ url('ftn/domain/addedit') }}">Add New Domain</a></td>
</tr>
@endcan
@foreach (\App\Models\Domain::orderBy('name')->cursor() as $oo)
@foreach (\App\Models\Domain::orderBy('name')->with(['zones'])->get() as $oo)
<tr>
<td><a href="{{ url('ftn/domain/addedit',[$oo->id]) }}">{{ $oo->id }}</a></td>
<td>{{ $oo->name }}</td>

View File

@@ -101,16 +101,18 @@
</tr>
<!-- If this node is a hub -->
@foreach ($oz->addresses()->active()->FTNorder()->where('hub_id',$ao->id)->with(['system','zone.domain'])->get() as $aoo)
<tr>
<td>{{ $aoo->system->full_name($aoo) }}</td>
<td>{{ $aoo->system->sysop }}</td>
<td>{{ $ao->system->location }}</td>
<td>{{ $aoo->role }}</td>
<td>{{ $aoo->ftn }}</td>
<td>-</td>
</tr>
@endforeach
@if ($ao->role == 'Hub')
@foreach ($oz->addresses()->active()->FTNorder()->where('hub_id',$ao->id)->with(['system','zone.domain'])->get() as $aoo)
<tr>
<td>{{ $aoo->system->full_name($aoo) }}</td>
<td>{{ $aoo->system->sysop }}</td>
<td>{{ $ao->system->location }}</td>
<td>{{ $aoo->role }}</td>
<td>{{ $aoo->ftn }}</td>
<td>-</td>
</tr>
@endforeach
@endif
@endforeach
@endforeach
</tbody>