userModel = new User(); $this->loginLogModel = new LoginLog(); } /** * 로그인 기록 조회 */ public function loginLog(int $userID, SearchData $params): object { $loginLogs = $this->loginLogModel->logs($userID, $params); if ($loginLogs->rows > 0) { $num = listNum($loginLogs->total, $params->page, $params->perPage); foreach ($loginLogs->list as $i => $row) { $row->num = $num--; $row->os = $this->platform($row->user_agent); $row->browser = $this->browser($row->user_agent); $row->device = $this->device($row->user_agent); $row->result = ($row->success ? '성공' : '실패'); $loginLogs->list[$i] = $row; } } return $loginLogs; } }