컨트롤러수정
This commit is contained in:
82
app/Controllers/Results/Assign.php
Normal file
82
app/Controllers/Results/Assign.php
Normal 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user