Show message numbers in echorea list

This commit is contained in:
Deon George 2021-08-12 00:15:58 +10:00
parent eb0405f019
commit 8996b3d09b
2 changed files with 12 additions and 1 deletions

View File

@ -204,6 +204,7 @@ return [
'Blade' => Illuminate\Support\Facades\Blade::class,
'Broadcast' => Illuminate\Support\Facades\Broadcast::class,
'Bus' => Illuminate\Support\Facades\Bus::class,
'Carbon' => \Carbon\Carbon::class,
'Cache' => Illuminate\Support\Facades\Cache::class,
'Config' => Illuminate\Support\Facades\Config::class,
'Cookie' => Illuminate\Support\Facades\Cookie::class,

View File

@ -28,12 +28,19 @@
<div class="accordion-body">
@if($o->echoareas->count())
<p>This network provides the following Echomail areas:</p>
<table class="table monotable" id="network">
<table class="table monotable w-100" id="network">
<thead>
<tr>
<th colspan="3"></th>
<th colspan="3" class="text-center">Messages</th>
</tr>
<tr>
<th>Echoarea</th>
<th>Description</th>
<th>Last Message</th>
<th class="text-end">Day</th>
<th class="text-end">Week</th>
<th class="text-end">Month</th>
</tr>
</thead>
@ -43,6 +50,9 @@
<td><a href="{{ url('ftn/echoarea/addedit',[$oo->id]) }}">{{ $oo->name }}</a></td>
<td>{{ $oo->description }}</td>
<td>{{ ($x=$oo->echomail()->orderBy('created_at','DESC')->first()) ? $x->created_at->format('Y-m-d H:i') : '-' }}</td>
<td class="text-end">{{ number_format($oo->echomail()->where('created_at','>=',Carbon::now()->subDay())->count()) }}</td>
<td class="text-end">{{ number_format($oo->echomail()->where('created_at','>=',Carbon::now()->subWeek())->count()) }}</td>
<td class="text-end">{{ number_format($oo->echomail()->where('created_at','>=',Carbon::now()->subMonth())->count()) }}</td>
</tr>
@endforeach
</tbody>