컨트롤러수정

This commit is contained in:
yangsh
2025-12-23 17:42:15 +09:00
parent 20f8163a0e
commit f4af2a19dc
23 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,82 @@
<?php
namespace App\Controllers\results;
use App\Controllers\BaseController;
use App\Models\results\AssignModel;
class Assign extends BaseController
{
private $assignModel;
public function __construct()
{
$this->assignModel = new AssignModel();
}
public function lists(): string
{
$bonbu = $this->assignModel->getBonbuList();
$team = $this->assignModel->getTeamList();
$sido = $this->assignModel->getAreaList();
return view("pages/results/assign/stats_a01", [
'bonbu' => $bonbu,
'team' => $team,
'sido' => $sido,
]);
}
public function getUserList()
{
$start = (int) $this->request->getGet('start') ?: 0;
$end = (int) $this->request->getGet('length') ?: 10;
$data = [
'bonbu' => $this->request->getGet('bonbu'),
'team' => $this->request->getGet('team'),
'schDateGb' => $this->request->getGet('schDateGb'),
'sdate' => $this->request->getGet('sdate'),
'edate' => $this->request->getGet('edate'),
'srchType' => $this->request->getGet('srchType'),
'srchTxt' => $this->request->getGet('srchTxt'),
];
$totalCount = $this->assignModel->getTotalCount($data);
$datas = $this->assignModel->getUserList($start, $end, $data);
return $this->response->setJSON(body: [
'recordsTotal' => $totalCount,
'recordsFiltered' => $totalCount,
'data' => $datas,
]);
}
// 엑셀 다운로드
public function excel()
{
try {
$data = [
'bonbu' => $this->request->getGet('bonbu'),
'team' => $this->request->getGet('team'),
'schDateGb' => $this->request->getGet('schDateGb'),
'sdate' => $this->request->getGet('sdate'),
'edate' => $this->request->getGet('edate'),
'srchType' => $this->request->getGet('srchType'),
'srchTxt' => $this->request->getGet('srchTxt'),
];
$datas = $this->assignModel->getExcelUserList($data);
return $this->response->setJSON(body: [
'data' => $datas,
]);
} catch (\Exception $e) {
$e->getPrevious()->getTraceAsString();
}
}
}