Guillermo - staff/add-last-login [skip ci]
This commit is contained in:
parent
5f3eb6c00f
commit
97ef914d27
|
@ -35,6 +35,7 @@ class GetAllStaffController extends Controller {
|
|||
'departments' => $staff->sharedDepartmentList->toArray(),
|
||||
'assignedTickets' => $assignedTickets,
|
||||
'closedTickets' => $closedTickets,
|
||||
'lastLogin' => $staff->lastLogin
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
@ -22,6 +22,10 @@ class LoginController extends Controller {
|
|||
if ($this->checkInputCredentials() || $this->checkRememberToken()) {
|
||||
$this->createUserSession();
|
||||
$this->createSessionCookie();
|
||||
if(Controller::request('staff')) {
|
||||
$this->userInstance->lastLogin = Date::getCurrentDate();
|
||||
$this->userInstance->store();
|
||||
}
|
||||
|
||||
Response::respondSuccess($this->getUserData());
|
||||
} else {
|
||||
|
|
|
@ -17,7 +17,8 @@ class Staff extends DataStore {
|
|||
'profilePic',
|
||||
'level',
|
||||
'sharedDepartmentList',
|
||||
'sharedTicketList'
|
||||
'sharedTicketList',
|
||||
'lastLogin'
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -39,7 +40,8 @@ class Staff extends DataStore {
|
|||
'profilePic' => $this->profilePic,
|
||||
'level' => $this->level,
|
||||
'departments' => $this->sharedDepartmentList->toArray(),
|
||||
'tickets' => $this->sharedTicketList->toArray()
|
||||
'tickets' => $this->sharedTicketList->toArray(),
|
||||
'lastLogin' => $this->lastLogin
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue