Guillermo - staff/add-last-login [skip ci]

This commit is contained in:
Ivan Diaz 2016-12-08 17:39:47 -03:00
parent 5f3eb6c00f
commit 97ef914d27
3 changed files with 9 additions and 2 deletions

View File

@ -35,6 +35,7 @@ class GetAllStaffController extends Controller {
'departments' => $staff->sharedDepartmentList->toArray(),
'assignedTickets' => $assignedTickets,
'closedTickets' => $closedTickets,
'lastLogin' => $staff->lastLogin
];
}

View File

@ -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 {

View File

@ -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
];
}
}