last login user
This commit is contained in:
@ -86,12 +86,15 @@ class Users extends Authenticatable
|
|||||||
Users::defaultSelected .
|
Users::defaultSelected .
|
||||||
"
|
"
|
||||||
$select_select
|
$select_select
|
||||||
|
, ul.crt lastLogin
|
||||||
FROM t_users AS u
|
FROM t_users AS u
|
||||||
LEFT JOIN t_clients AS c ON u.client_group_id = c.id
|
LEFT JOIN t_clients AS c ON u.client_group_id = c.id
|
||||||
-- LEFT JOIN t_users_roles AS r ON u.role = r.id
|
-- LEFT JOIN t_users_roles AS r ON u.role = r.id
|
||||||
LEFT JOIN model_has_roles AS mhr ON mhr.model_id = u.id
|
LEFT JOIN model_has_roles AS mhr ON mhr.model_id = u.id
|
||||||
LEFT JOIN roles as rl ON rl.id = mhr.role_id
|
LEFT JOIN roles as rl ON rl.id = mhr.role_id
|
||||||
$join_join
|
$join_join
|
||||||
|
left join (select userId, crt from t_user_log where log->'$.desc' = 'User login' order by crt desc limit 1) ul
|
||||||
|
on ul.userId = u.id
|
||||||
WHERE u.dlt is null
|
WHERE u.dlt is null
|
||||||
$where_where
|
$where_where
|
||||||
$other_other
|
$other_other
|
||||||
|
|||||||
@ -46,6 +46,7 @@
|
|||||||
<th class="text-nowrap">Phone</th>
|
<th class="text-nowrap">Phone</th>
|
||||||
<th class="text-nowrap">Email</th>
|
<th class="text-nowrap">Email</th>
|
||||||
<th class="text-nowrap">Join Date</th>
|
<th class="text-nowrap">Join Date</th>
|
||||||
|
<th class="text-nowrap">Last Login</th>
|
||||||
<th class="text-nowrap">Company</th>
|
<th class="text-nowrap">Company</th>
|
||||||
<th class="text-start">Role</th>
|
<th class="text-start">Role</th>
|
||||||
<th class="text-center">Status</th>
|
<th class="text-center">Status</th>
|
||||||
@ -708,6 +709,16 @@
|
|||||||
return moment.unix(data).format('DD MMM YYYY HH:mm')
|
return moment.unix(data).format('DD MMM YYYY HH:mm')
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
data: 'lastLogin',
|
||||||
|
className: 'text-start text-nowrap',
|
||||||
|
visible: true,
|
||||||
|
orderable: true,
|
||||||
|
searchable: true,
|
||||||
|
render: function(data, type, row, meta) {
|
||||||
|
return data ? moment.unix(data).format('DD MMM YYYY HH:mm') : '-';
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
data: 'client_group_name',
|
data: 'client_group_name',
|
||||||
className: 'text-start text-nowrap',
|
className: 'text-start text-nowrap',
|
||||||
|
|||||||
@ -45,16 +45,14 @@
|
|||||||
<th class="text-center">Action</th>
|
<th class="text-center">Action</th>
|
||||||
<th class="">Vehicle</th>
|
<th class="">Vehicle</th>
|
||||||
<th class="">Name</th>
|
<th class="">Name</th>
|
||||||
<!-- <th class="">Tax Exp</th> -->
|
<th class="">Manufacture Year</th>
|
||||||
{{-- <th class="">Kir Exp</th> --}}
|
<th class="">Type</th>
|
||||||
<th class="">Service Start</th>
|
<th class="">Service Start</th>
|
||||||
@if ($user_role != \App\Models\Users::ROLE_VENDOR)
|
@if ($user_role != \App\Models\Users::ROLE_VENDOR)
|
||||||
<th class="">Device ID</th>
|
<th class="">Device ID</th>
|
||||||
<th class="">SIM Card</th>
|
<th class="">SIM Card</th>
|
||||||
<th class="">Last Update</th>
|
<th class="">Last Update</th>
|
||||||
@endif
|
@endif
|
||||||
<th class="">Type</th>
|
|
||||||
<th class="">Manufacture Year</th>
|
|
||||||
<th class=""><span class="text-nowrap">Mileage <span class="text-lowercase">(km)</span></span></th>
|
<th class=""><span class="text-nowrap">Mileage <span class="text-lowercase">(km)</span></span></th>
|
||||||
<th class=""><span class="text-nowrap">Fuel <span class="text-lowercase">(L)</span></span></th>
|
<th class=""><span class="text-nowrap">Fuel <span class="text-lowercase">(L)</span></span></th>
|
||||||
<th class="">Company</th>
|
<th class="">Company</th>
|
||||||
@ -754,6 +752,27 @@
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{ data: 'name', className: 'text-start text-nowrap', visible: true, orderable: true, searchable: true },
|
{ data: 'name', className: 'text-start text-nowrap', visible: true, orderable: true, searchable: true },
|
||||||
|
{
|
||||||
|
data: 'vyear',
|
||||||
|
className: 'text-end',
|
||||||
|
visible: true,
|
||||||
|
orderable: true,
|
||||||
|
searchable: true,
|
||||||
|
render: function(data, type, row, meta) {
|
||||||
|
return (`${(data || '-')}`);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
data: 'type_name',
|
||||||
|
className: 'text-start text-nowrap',
|
||||||
|
visible: true,
|
||||||
|
orderable: true,
|
||||||
|
searchable: true,
|
||||||
|
render: function(data, type, row, meta) {
|
||||||
|
// return (`${row.brand_name}<br>-<br>${data}`);
|
||||||
|
return data;
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
data: 'crt',
|
data: 'crt',
|
||||||
className: 'text-end text-nowrap',
|
className: 'text-end text-nowrap',
|
||||||
@ -799,27 +818,6 @@
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
@endif
|
@endif
|
||||||
{
|
|
||||||
data: 'type_name',
|
|
||||||
className: 'text-start text-nowrap',
|
|
||||||
visible: true,
|
|
||||||
orderable: true,
|
|
||||||
searchable: true,
|
|
||||||
render: function(data, type, row, meta) {
|
|
||||||
// return (`${row.brand_name}<br>-<br>${data}`);
|
|
||||||
return data;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
data: 'vyear',
|
|
||||||
className: 'text-end',
|
|
||||||
visible: true,
|
|
||||||
orderable: true,
|
|
||||||
searchable: true,
|
|
||||||
render: function(data, type, row, meta) {
|
|
||||||
return (`${(data || '-')}`);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
data: 'sum_milleage',
|
data: 'sum_milleage',
|
||||||
className: 'text-end',
|
className: 'text-end',
|
||||||
|
|||||||
Reference in New Issue
Block a user