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, 'Blade' => Illuminate\Support\Facades\Blade::class,
'Broadcast' => Illuminate\Support\Facades\Broadcast::class, 'Broadcast' => Illuminate\Support\Facades\Broadcast::class,
'Bus' => Illuminate\Support\Facades\Bus::class, 'Bus' => Illuminate\Support\Facades\Bus::class,
'Carbon' => \Carbon\Carbon::class,
'Cache' => Illuminate\Support\Facades\Cache::class, 'Cache' => Illuminate\Support\Facades\Cache::class,
'Config' => Illuminate\Support\Facades\Config::class, 'Config' => Illuminate\Support\Facades\Config::class,
'Cookie' => Illuminate\Support\Facades\Cookie::class, 'Cookie' => Illuminate\Support\Facades\Cookie::class,

View File

@ -28,12 +28,19 @@
<div class="accordion-body"> <div class="accordion-body">
@if($o->echoareas->count()) @if($o->echoareas->count())
<p>This network provides the following Echomail areas:</p> <p>This network provides the following Echomail areas:</p>
<table class="table monotable" id="network"> <table class="table monotable w-100" id="network">
<thead> <thead>
<tr>
<th colspan="3"></th>
<th colspan="3" class="text-center">Messages</th>
</tr>
<tr> <tr>
<th>Echoarea</th> <th>Echoarea</th>
<th>Description</th> <th>Description</th>
<th>Last Message</th> <th>Last Message</th>
<th class="text-end">Day</th>
<th class="text-end">Week</th>
<th class="text-end">Month</th>
</tr> </tr>
</thead> </thead>
@ -43,6 +50,9 @@
<td><a href="{{ url('ftn/echoarea/addedit',[$oo->id]) }}">{{ $oo->name }}</a></td> <td><a href="{{ url('ftn/echoarea/addedit',[$oo->id]) }}">{{ $oo->name }}</a></td>
<td>{{ $oo->description }}</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>{{ ($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> </tr>
@endforeach @endforeach
</tbody> </tbody>