Files
confirms/app/Controllers/manage/LoginLog.php
yangsh 735120f1cb
Some checks failed
Close Pull Request / main (pull_request_target) Has been cancelled
new
2025-12-09 17:28:31 +09:00

56 lines
1.2 KiB
PHP

<?php
namespace App\Controllers\manage;
use App\Controllers\BaseController;
use App\Models\manage\LoginLogModel;
class LoginLog extends BaseController
{
private $logModel;
public function __construct()
{
$this->logModel = new LoginLogModel();
}
public function lists()
{
return view("pages/manage/log/lists");
}
public function getLogList()
{
$start = (int) $this->request->getGet('start') ?: 0;
$end = (int) $this->request->getGet('length') ?: 10;
$data = [
'srchTxt' => $this->request->getGet('search[value]') ?: '',
];
$totalCount = $this->logModel->getTotalCount($data);
$datas = $this->logModel->getLoginLogList($start, $end, $data);
return $this->response->setJSON(body: [
'recordsTotal' => $totalCount,
'recordsFiltered' => $totalCount,
'data' => $datas,
]);
}
public function excel()
{
$data = [
'srchTxt' => $this->request->getGet('search[value]') ?: '',
];
$datas = $this->logModel->getExcelDownList($data);
return $this->response->setJSON(body: [
'data' => $datas,
]);
}
}