Cache some calls to Mongo for performance
This commit is contained in:
@@ -50,10 +50,10 @@
|
||||
<tr>
|
||||
<td style="width: 15%;"><a href="{{ url('ftn/echoarea/addedit',[$oo->id]) }}">{{ $oo->name }}</a></td>
|
||||
<td>{{ $oo->description }}</td>
|
||||
<td style="width: 15%;">{{ ($x=$oo->echomail()->orderBy('datetime','DESC')->first()) ? $x->datetime->format('Y-m-d H:i') : '-' }}</td>
|
||||
<td class="text-end">{{ number_format($oo->echomail()->where('datetime','>=',Carbon::now()->subDay())->count()) }}</td>
|
||||
<td class="text-end">{{ number_format($oo->echomail()->where('datetime','>=',Carbon::now()->subWeek())->count()) }}</td>
|
||||
<td class="text-end">{{ number_format($oo->echomail()->where('datetime','>=',Carbon::now()->subMonth())->count()) }}</td>
|
||||
<td style="width: 15%;">{{ $oo->last_message ? $oo->last_message->format('Y-m-d H:i') : '-' }}</td>
|
||||
<td class="text-end">{{ number_format($oo->messages_count(1)) }}</td>
|
||||
<td class="text-end">{{ number_format($oo->messages_count(7)) }}</td>
|
||||
<td class="text-end">{{ number_format($oo->messages_count(30)) }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
@@ -276,7 +276,7 @@
|
||||
}
|
||||
},
|
||||
series: [
|
||||
@foreach($o->echoareas as $oo)
|
||||
@foreach($o->echoareas->sortBy('name') as $oo)
|
||||
{
|
||||
name: '{{ $oo->name }}',
|
||||
data: {!! $o->daily_echoarea_stats($oo) !!},
|
||||
|
Reference in New Issue
Block a user