Performance workarounds as a result of 1bba21 - need to work on with()

This commit is contained in:
Deon George
2021-07-02 15:10:22 +10:00
parent 1bba21dcef
commit 90190bb301
5 changed files with 13 additions and 10 deletions

View File

@@ -5,7 +5,7 @@
</div>
<div class="card-body">
@if($o->payments->where('date_orig','>',($x=\Carbon\Carbon::now()->subMonths(12)))->count())
@if(($x=$o->payments()->where('ab_payment.date_orig','>',\Carbon\Carbon::now()->subMonths(12)->unix())->with(['items','account'])->get())->count())
<table class="table table-bordered w-100" id="payments_past">
<thead>
<tr>
@@ -19,7 +19,7 @@
</thead>
<tbody>
@foreach ($o->payments->where('date_orig','>',($x=\Carbon\Carbon::now()->subMonths(12))) as $oo)
@foreach ($x as $oo)
<tr>
<td>{{ $oo->account->name }}</td>
<td>{{ $oo->sid }}</td>