This commit is contained in:
56
app/Controllers/manage/LoginLog.php
Normal file
56
app/Controllers/manage/LoginLog.php
Normal file
@@ -0,0 +1,56 @@
|
||||
<?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,
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user