public function showUserLoginRecordAction(Request $request, $id) { $user = $this->getUserService()->getUser($id); $paginator = new Paginator($this->get('request'), $this->getLogService()->searchLogCount(array('userId' => $user['id'])), 8); $loginRecords = $this->getLogService()->searchLogs(array('userId' => $user['id']), 'created', $paginator->getOffsetCount(), $paginator->getPerPageCount()); $loginRecords = ConvertIpToolkit::ConvertIps($loginRecords); return $this->render('TopxiaAdminBundle:LoginRecord:login-record-details.html.twig', array('user' => $user, 'loginRecords' => $loginRecords, 'loginRecordPaginator' => $paginator)); }
public function getConvertIP($IP) { if (!empty($IP)) { $location = ConvertIpToolkit::convertIp($IP); if ($location === 'INNA') { return '未知区域'; } return $location; } return ''; }