컨트롤러수정
This commit is contained in:
75
app/Controllers/Results/M409.php
Normal file
75
app/Controllers/Results/M409.php
Normal file
@@ -0,0 +1,75 @@
|
||||
<?php
|
||||
namespace App\Controllers\results;
|
||||
|
||||
use App\Controllers\BaseController;
|
||||
use App\Models\results\M409Model;
|
||||
|
||||
class M409 extends BaseController
|
||||
{
|
||||
|
||||
private $model;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->model = new M409Model();
|
||||
}
|
||||
|
||||
public function stats(): string
|
||||
{
|
||||
$codes = $this->model->getCodeList(['VRFCREQ_WAY', 'CP_ID']);
|
||||
|
||||
$CODE_VRFCREQ_WAY = convertArrayToHashTable($codes['VRFCREQ_WAY'], 'cd', 'cd_nm', []);
|
||||
$CODE_CP_ID = convertArrayToHashTable($codes['CP_ID'], 'cd', 'cd_nm', []);
|
||||
|
||||
return view("pages/results/m409/stats", [
|
||||
'code_vrfcreq_way' => $CODE_VRFCREQ_WAY,
|
||||
'code_cp_id' => $CODE_CP_ID,
|
||||
]);
|
||||
}
|
||||
|
||||
public function getResultList()
|
||||
{
|
||||
$data = [
|
||||
'sdate' => $this->request->getGet('sdate'),
|
||||
'edate' => $this->request->getGet('edate'),
|
||||
'vrfcreq_way' => $this->request->getGet('vrfcreq_way'),
|
||||
'cp_id' => $this->request->getGet('cp_id'),
|
||||
];
|
||||
|
||||
$totalCount = $this->model->getTotalCount($data);
|
||||
|
||||
|
||||
$datas = $this->model->getResultList($data);
|
||||
|
||||
return $this->response->setJSON(body: [
|
||||
'recordsTotal' => $totalCount,
|
||||
'recordsFiltered' => $totalCount,
|
||||
'data' => $datas,
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
|
||||
// 엑셀 다운로드
|
||||
public function excel()
|
||||
{
|
||||
try {
|
||||
|
||||
$data = [
|
||||
'sdate' => $this->request->getGet('sdate'),
|
||||
'edate' => $this->request->getGet('edate'),
|
||||
'vrfcreq_way' => $this->request->getGet('vrfcreq_way'),
|
||||
'cp_id' => $this->request->getGet('cp_id'),
|
||||
];
|
||||
|
||||
$datas = $this->model->getExcelList($data);
|
||||
|
||||
return $this->response->setJSON(body: [
|
||||
'data' => $datas,
|
||||
]);
|
||||
|
||||
} catch (\Exception $e) {
|
||||
$e->getPrevious()->getTraceAsString();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user