mirror of
https://github.com/opensupports/opensupports.git
synced 2025-07-31 01:35:15 +02:00
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(),
|
'departments' => $staff->sharedDepartmentList->toArray(),
|
||||||
'assignedTickets' => $assignedTickets,
|
'assignedTickets' => $assignedTickets,
|
||||||
'closedTickets' => $closedTickets,
|
'closedTickets' => $closedTickets,
|
||||||
|
'lastLogin' => $staff->lastLogin
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,6 +22,10 @@ class LoginController extends Controller {
|
|||||||
if ($this->checkInputCredentials() || $this->checkRememberToken()) {
|
if ($this->checkInputCredentials() || $this->checkRememberToken()) {
|
||||||
$this->createUserSession();
|
$this->createUserSession();
|
||||||
$this->createSessionCookie();
|
$this->createSessionCookie();
|
||||||
|
if(Controller::request('staff')) {
|
||||||
|
$this->userInstance->lastLogin = Date::getCurrentDate();
|
||||||
|
$this->userInstance->store();
|
||||||
|
}
|
||||||
|
|
||||||
Response::respondSuccess($this->getUserData());
|
Response::respondSuccess($this->getUserData());
|
||||||
} else {
|
} else {
|
||||||
|
@ -17,7 +17,8 @@ class Staff extends DataStore {
|
|||||||
'profilePic',
|
'profilePic',
|
||||||
'level',
|
'level',
|
||||||
'sharedDepartmentList',
|
'sharedDepartmentList',
|
||||||
'sharedTicketList'
|
'sharedTicketList',
|
||||||
|
'lastLogin'
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -39,7 +40,8 @@ class Staff extends DataStore {
|
|||||||
'profilePic' => $this->profilePic,
|
'profilePic' => $this->profilePic,
|
||||||
'level' => $this->level,
|
'level' => $this->level,
|
||||||
'departments' => $this->sharedDepartmentList->toArray(),
|
'departments' => $this->sharedDepartmentList->toArray(),
|
||||||
'tickets' => $this->sharedTicketList->toArray()
|
'tickets' => $this->sharedTicketList->toArray(),
|
||||||
|
'lastLogin' => $this->lastLogin
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user