Skip to content

Commit e60e3a2

Browse files
committed
tickets count column
1 parent 29cc649 commit e60e3a2

4 files changed

Lines changed: 12 additions & 1 deletion

File tree

src/Controllers/MembersController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class MembersController extends Controller
1717
*/
1818
public function index(Request $request)
1919
{
20-
$a_members = Models\Member::orderBy('name')->get();
20+
$a_members = Models\Member::withCount(['userTickets', 'agentTotalTickets'])->orderBy('name')->get();
2121

2222
return view('panichd::admin.member.index', compact('a_members'));
2323
}

src/Translations/ca/lang.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@
157157
'subject' => 'Tema',
158158
'tags' => 'Etiquetes',
159159
'ticket' => 'Tiquet',
160+
'tickets' => 'Tiquets',
160161
'today' => 'Avui',
161162
'tomorrow' => 'Demà',
162163
'update' => 'Actualitzar',

src/Translations/en/lang.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@
158158
'subject' => 'Subject',
159159
'tags' => 'Tags',
160160
'ticket' => 'Ticket',
161+
'tickets' => 'Tickets',
161162
'today' => 'Today',
162163
'tomorrow' => 'Tomorrow',
163164
'update' => 'Update',

src/Views/admin/member/index.blade.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
<td>{{ trans('panichd::admin.table-name') }}</td>
3333
<td>{{ trans('panichd::admin.table-email') }}</td>
3434
<td>{{ trans('panichd::admin.role') }}</td>
35+
<td>{{ trans('panichd::lang.tickets') }}
3536
<td>{{ trans('panichd::admin.table-action') }}</td>
3637
</tr>
3738
</thead>
@@ -50,6 +51,14 @@
5051
@endif
5152
</td>
5253
<td>
54+
@if ($member->user_tickets_count != 0)
55+
<button type="button" disabled="disabled" class="btn btn-default btn-xs">{{ $member->user_tickets_count }}</button>
56+
@endif
57+
@if ($member->agent_total_tickets_count != 0)
58+
<button type="button" disabled="disabled" class="btn btn-warning btn-xs">{{ $member->agent_total_tickets_count }}</button>
59+
@endif
60+
</td>
61+
<td>
5362
<button type="button" class="btn btn-default btn_member_modal" data-member_id="{{ $member->id }}" data-member_name="{{ $member->name }}" data-member_email="{{ $member->email }}" data-route="update" data-form_action="{{ route($setting->grab('admin_route').'.member.update', ['id' => $member->id ]) }}">{{ trans('panichd::admin.btn-edit') }}</button>
5463
@if ($member->panichd_admin != '1')
5564
{!! link_to_route(

0 commit comments

Comments
 (0)