컨트롤러수정
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
98
app/Controllers/Results/Dept.php
Normal file
98
app/Controllers/Results/Dept.php
Normal file
@@ -0,0 +1,98 @@
|
||||
<?php
|
||||
namespace App\Controllers\results;
|
||||
|
||||
use App\Controllers\BaseController;
|
||||
use App\Models\results\DeptModel;
|
||||
|
||||
class Dept extends BaseController
|
||||
{
|
||||
private $deptModel;
|
||||
private $schDateGb = ''; // 일자구분
|
||||
private $sdate = ''; // 시작일자
|
||||
private $edate = ''; // 종료일자
|
||||
|
||||
private $bonbu = ''; // 본부
|
||||
private $dept_sq = ''; // 팀
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->deptModel = new DeptModel();
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function lists(): string
|
||||
{
|
||||
|
||||
|
||||
$this->schDateGb = $this->request->getPost('schDateGb') ?? '1';
|
||||
|
||||
$this->sdate = $this->request->getPost('sdate');
|
||||
if (empty($this->sdate)) {
|
||||
$this->sdate = date('Y-m-01'); // 이번달 1일
|
||||
}
|
||||
|
||||
$this->edate = $this->request->getPost('edate');
|
||||
if (empty($this->edate)) {
|
||||
$this->edate = date('Y-m-t'); // 이번달 말일
|
||||
}
|
||||
|
||||
$this->bonbu = $this->request->getPost('bonbu');
|
||||
if (empty($this->bonbu)) {
|
||||
$this->bonbu = '';
|
||||
}
|
||||
|
||||
$this->dept_sq = $this->request->getPost('dept_sq');
|
||||
if (empty($this->dept_sq)) {
|
||||
$this->dept_sq = '';
|
||||
}
|
||||
|
||||
$data = [
|
||||
'schDateGb' => $this->schDateGb,
|
||||
'sdate' => $this->sdate,
|
||||
'edate' => $this->edate,
|
||||
'bonbu' => $this->bonbu,
|
||||
'dept_sq' => $this->dept_sq,
|
||||
];
|
||||
|
||||
$bonbu = $this->deptModel->getBonbuList();
|
||||
$team = $this->deptModel->getTeamList();
|
||||
|
||||
$res = $this->deptModel->st_d01($data);
|
||||
|
||||
return view("pages/results/dept/stats_d01", [
|
||||
'pBonbu' => $this->bonbu,
|
||||
'pDeptSq' => $this->dept_sq,
|
||||
'schDateGb' => $this->schDateGb,
|
||||
'sdate' => $this->sdate,
|
||||
'edate' => $this->edate,
|
||||
'bonbu' => $bonbu,
|
||||
'team' => $team,
|
||||
'st_list' => $res,
|
||||
]);
|
||||
}
|
||||
|
||||
// 엑셀 다운로드
|
||||
public function excel()
|
||||
{
|
||||
$data = [
|
||||
'schDateGb' => $this->request->getGet('schDateGb'),
|
||||
'sdate' => $this->request->getGet('sdate'),
|
||||
'edate' => $this->request->getGet('edate'),
|
||||
'bonbu' => $this->request->getGet('bonbu'),
|
||||
'dept_sq' => $this->request->getGet('dept_sq'),
|
||||
];
|
||||
|
||||
|
||||
$res = $this->deptModel->getExcelList($data);
|
||||
|
||||
return $this->response->setJSON(body: [
|
||||
'data' => $res,
|
||||
]);
|
||||
}
|
||||
}
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
74
app/Controllers/Results/M410.php
Normal file
74
app/Controllers/Results/M410.php
Normal file
@@ -0,0 +1,74 @@
|
||||
<?php
|
||||
namespace App\Controllers\results;
|
||||
|
||||
use App\Controllers\BaseController;
|
||||
use App\Models\results\M410Model;
|
||||
|
||||
class M410 extends BaseController
|
||||
{
|
||||
private $model;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->model = new M410Model();
|
||||
}
|
||||
|
||||
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', []);
|
||||
$department = $this->model->getDepart();
|
||||
|
||||
return view("pages/results/m410/stats", [
|
||||
'code_vrfcreq_way' => $CODE_VRFCREQ_WAY,
|
||||
'code_cp_id' => $CODE_CP_ID,
|
||||
'department' => $department,
|
||||
]);
|
||||
}
|
||||
|
||||
public function getResultList()
|
||||
{
|
||||
$data = [
|
||||
'sdate' => $this->request->getGet('sdate'),
|
||||
'edate' => $this->request->getGet('edate'),
|
||||
'dept_sq' => $this->request->getGet('dept_sq'),
|
||||
'vrfcreq_way' => $this->request->getGet('vrfcreq_way'),
|
||||
];
|
||||
|
||||
$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'),
|
||||
'dept_sq' => $this->request->getGet('dept_sq'),
|
||||
'vrfcreq_way' => $this->request->getGet('vrfcreq_way'),
|
||||
];
|
||||
|
||||
$datas = $this->model->getResultList($data);
|
||||
|
||||
return $this->response->setJSON(body: [
|
||||
'data' => $datas,
|
||||
]);
|
||||
|
||||
} catch (\Exception $e) {
|
||||
$e->getPrevious()->getTraceAsString();
|
||||
}
|
||||
}
|
||||
}
|
||||
62
app/Controllers/Results/M411.php
Normal file
62
app/Controllers/Results/M411.php
Normal file
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
namespace App\Controllers\results;
|
||||
|
||||
use App\Controllers\BaseController;
|
||||
use App\Models\results\M411Model;
|
||||
|
||||
class M411 extends BaseController
|
||||
{
|
||||
private $model;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->model = new M411Model();
|
||||
}
|
||||
|
||||
public function stats(): string
|
||||
{
|
||||
return view("pages/results/m411/stats", [
|
||||
]);
|
||||
}
|
||||
|
||||
public function getResultList()
|
||||
{
|
||||
$data = [
|
||||
'sdate' => $this->request->getGet('sdate'),
|
||||
'edate' => $this->request->getGet('edate'),
|
||||
];
|
||||
|
||||
$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'),
|
||||
];
|
||||
|
||||
$datas = $this->model->getResultList($data);
|
||||
|
||||
return $this->response->setJSON(body: [
|
||||
'data' => $datas,
|
||||
]);
|
||||
|
||||
} catch (\Exception $e) {
|
||||
$e->getPrevious()->getTraceAsString();
|
||||
}
|
||||
}
|
||||
}
|
||||
233
app/Controllers/Results/M412.php
Normal file
233
app/Controllers/Results/M412.php
Normal file
@@ -0,0 +1,233 @@
|
||||
<?php
|
||||
namespace App\Controllers\results;
|
||||
|
||||
use App\Controllers\BaseController;
|
||||
use App\Models\common\SmsModel;
|
||||
use App\Models\results\M412Model;
|
||||
|
||||
|
||||
class M412 extends BaseController
|
||||
{
|
||||
|
||||
private $model;
|
||||
private $smsModel;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->model = new M412Model();
|
||||
$this->smsModel = new SmsModel();
|
||||
}
|
||||
|
||||
|
||||
public function stats(): string
|
||||
{
|
||||
$sendH = $this->model->get_send_yn('H');
|
||||
$sendD = $this->model->get_send_yn('D');
|
||||
$sendT = $this->model->get_send_yn('T');
|
||||
$sendN = $this->model->get_send_yn('N');
|
||||
$sendJ = $this->model->get_send_yn('J');
|
||||
$sendO = $this->model->get_send_yn('O');
|
||||
|
||||
return view("pages/results/m412/stats", [
|
||||
'sendH' => $sendH,
|
||||
'sendD' => $sendD,
|
||||
'sendT' => $sendT,
|
||||
'sendN' => $sendN,
|
||||
'sendJ' => $sendJ,
|
||||
'sendO' => $sendO,
|
||||
]);
|
||||
}
|
||||
|
||||
public function getResultList()
|
||||
{
|
||||
$data = [
|
||||
'sdate' => $this->request->getGet('sdate'),
|
||||
'edate' => $this->request->getGet('edate'),
|
||||
];
|
||||
|
||||
$totalCount = $this->model->getTotalCount($data);
|
||||
|
||||
$datas = $this->model->getResultList($data);
|
||||
|
||||
return $this->response->setJSON(body: [
|
||||
'recordsTotal' => $totalCount,
|
||||
'recordsFiltered' => $totalCount,
|
||||
'data' => $datas,
|
||||
]);
|
||||
}
|
||||
|
||||
// 타입별 전송 on/off 저장
|
||||
public function saveSendType()
|
||||
{
|
||||
try {
|
||||
|
||||
$usr_nm = session('usr_nm');
|
||||
$client_ip = getRealClientIp();
|
||||
|
||||
$data = [
|
||||
'type' => $this->request->getPost('type'),
|
||||
'yn' => $this->request->getPost('yn'),
|
||||
'usr_sq' => session('usr_sq'),
|
||||
];
|
||||
|
||||
// INSERT v2_stop_api_chg_stat
|
||||
$this->model->saveSendType($data);
|
||||
|
||||
$send_sms_member = [
|
||||
["name" => '김인', "tel" => '010-4010-8318'],
|
||||
["name" => "이민호", "tel" => '010-6743-3112'],
|
||||
["name" => "이권희", "tel" => '010-4706-3638'],
|
||||
];
|
||||
|
||||
|
||||
$send_h_yn = $this->model->get_send_yn('H');//가장 마지막의 홍보확인서 전송여부
|
||||
$send_t_yn = $this->model->get_send_yn('T'); //가장 마지막의 전화확인 전송여부
|
||||
$send_d_yn = $this->model->get_send_yn('D');//가장 마지막의 등기부등본 전송여부
|
||||
$send_n_yn = $this->model->get_send_yn('N'); //가장 마지막의 전화확인 전송여부
|
||||
$send_j_yn = $this->model->get_send_yn('J');//가장 마지막의 전화확인 전송여부
|
||||
$send_o_yn = $this->model->get_send_yn('O'); //가장 마지막의 모바일확인 V2 전송여부
|
||||
|
||||
|
||||
foreach ($send_sms_member as $member):
|
||||
|
||||
$dest_phone = $member['tel'];
|
||||
$dest_name = $member['name'];
|
||||
$send_phone = '1600-5749';
|
||||
$send_name = 'SYSTEM';
|
||||
$subject = '매물 전송 확인 -' . date("Y-m-d H:i:s");
|
||||
|
||||
$msg_body = '[' . date("Y-m-d H:i:s") . ']' . $usr_nm . "(" . $client_ip . ")" . '매물 전송 확인' . PHP_EOL
|
||||
. '홍보확인서:' . $send_h_yn . PHP_EOL
|
||||
. '전화확인:' . $send_t_yn . PHP_EOL
|
||||
. '등기부등본:' . $send_d_yn . PHP_EOL
|
||||
. '신홍보확인서:' . $send_n_yn . PHP_EOL
|
||||
. '공동중개매물:' . $send_j_yn . PHP_EOL
|
||||
. '모바일확인 V2:' . $send_o_yn;
|
||||
|
||||
|
||||
$msg_length = strlen(iconv('UTF-8', 'EUCKR', $msg_body));
|
||||
$msg_type = 0;
|
||||
if ($msg_length > 80 && $msg_type == 0) {
|
||||
$msg_type = 5;
|
||||
}
|
||||
|
||||
$memo = $msg_body;
|
||||
|
||||
// 문자 발송
|
||||
// $this->smsModel->sendSms($dest_phone, $dest_name, $send_phone, $send_name, $subject, $msg_body, $msg_type, $memo);
|
||||
|
||||
endforeach;
|
||||
|
||||
|
||||
|
||||
|
||||
return $this->response->setJSON([
|
||||
'code' => '0',
|
||||
'msg' => 'success'
|
||||
]);
|
||||
|
||||
} catch (\Exception $e) {
|
||||
return $this->response->setJSON([
|
||||
'code' => '9',
|
||||
'msg' => $e->getMessage(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
// 전화확인완료 처리
|
||||
public function saveSendComplete()
|
||||
{
|
||||
try {
|
||||
$data = [
|
||||
'sdate' => $this->request->getPost('sdate'),
|
||||
'edate' => $this->request->getPost('edate'),
|
||||
'stat_cd' => 35,
|
||||
];
|
||||
|
||||
$lists = $this->model->getLists($data);
|
||||
|
||||
if (empty($lists)) {
|
||||
return $this->response->setJSON([
|
||||
'status' => 'error',
|
||||
'msg' => '데이터 누락'
|
||||
]);
|
||||
} else {
|
||||
foreach ($lists as $row):
|
||||
$usr_sq = session('usr_sq');
|
||||
$stat_cd = 60;
|
||||
$vr_sq = $row['vr_sq'];
|
||||
$fax_sq = $row['fax_sq'];
|
||||
$toDay = date('Y-m-d H:i:s');
|
||||
$atcl_no = $row['atcl_no'];
|
||||
$vrfc_type = $row['vrfc_type'];
|
||||
$cpid = $row['cpid'];
|
||||
|
||||
// INSERT INTO v2_chg_stat
|
||||
$result_query8 = $this->model->chgStat($vr_sq, '60', $usr_sq, $toDay);
|
||||
|
||||
// UPDATE v2_vrfc_req
|
||||
$chgVrfc60 = $this->model->chgStatVrfc($vr_sq, '60'); //v2_vrfc_req INSERT
|
||||
|
||||
// UPDATE fax_imgs
|
||||
$statFaxUp60 = $this->model->chgStatFax($vr_sq, '60'); //fax_imgs
|
||||
|
||||
//★검증완료일때
|
||||
//0.불일치 이력이 있는지 확인
|
||||
$cnt = $this->model->getFaxFailTimeForHistory($vr_sq);
|
||||
if (empty($cnt)) {
|
||||
//1.서류전화 들어온시간
|
||||
$insert_tm = $this->model->getSaveTimeForHistory($vr_sq);
|
||||
//2.서류/전화 확인일자
|
||||
$tel_doc_conf_dt = $this->model->getConfTimeForHistory($vr_sq);
|
||||
//3.검증시간
|
||||
$finishTime = $this->model->get_60_ForHistory($vr_sq);
|
||||
//4.해당 정보를 테이블에 넣는다
|
||||
$this->model->insert_v2_time_required_Conf_Done($atcl_no, $cpid, $vrfc_type, $insert_tm['recv_time'], $tel_doc_conf_dt['insert_tm'], $finishTime['insert_tm']);
|
||||
}
|
||||
|
||||
// 홍보확인서완료 등기부등본확인 안함 저장
|
||||
$this->model->set_v2_st_daily(NULL, $cpid, 'D0205', '1', 'add');
|
||||
|
||||
endforeach;
|
||||
|
||||
echo json_encode(['error' => ['code' => '0', 'message' => $cnt . '건 - 처리되었습니다.']]);
|
||||
|
||||
}
|
||||
|
||||
|
||||
return $this->response->setJSON([
|
||||
'code' => '0',
|
||||
'msg' => 'success'
|
||||
]);
|
||||
|
||||
} catch (\Exception $e) {
|
||||
return $this->response->setJSON([
|
||||
'code' => '9',
|
||||
'msg' => $e->getMessage(),
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
// 엑셀 다운로드
|
||||
public function excel()
|
||||
{
|
||||
try {
|
||||
|
||||
$data = [
|
||||
'sdate' => $this->request->getGet('sdate'),
|
||||
'edate' => $this->request->getGet('edate'),
|
||||
];
|
||||
|
||||
$datas = $this->model->getResultList($data);
|
||||
|
||||
return $this->response->setJSON(body: [
|
||||
'data' => $datas,
|
||||
]);
|
||||
|
||||
} catch (\Exception $e) {
|
||||
$e->getPrevious()->getTraceAsString();
|
||||
}
|
||||
}
|
||||
}
|
||||
60
app/Controllers/Results/M415.php
Normal file
60
app/Controllers/Results/M415.php
Normal file
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
namespace App\Controllers\results;
|
||||
|
||||
use App\Controllers\BaseController;
|
||||
use App\Models\results\M415Model;
|
||||
|
||||
class M415 extends BaseController
|
||||
{
|
||||
private $model;
|
||||
public function __construct()
|
||||
{
|
||||
$this->model = new M415Model();
|
||||
}
|
||||
|
||||
public function stats(): string
|
||||
{
|
||||
return view("pages/results/m415/stats", [
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
public function getResultList()
|
||||
{
|
||||
$data = [
|
||||
'sdate' => $this->request->getGet('sdate'),
|
||||
'edate' => $this->request->getGet('edate'),
|
||||
];
|
||||
|
||||
$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'),
|
||||
];
|
||||
|
||||
$datas = $this->model->getResultList($data);
|
||||
|
||||
return $this->response->setJSON(body: [
|
||||
'data' => $datas,
|
||||
]);
|
||||
|
||||
} catch (\Exception $e) {
|
||||
$e->getPrevious()->getTraceAsString();
|
||||
}
|
||||
}
|
||||
}
|
||||
76
app/Controllers/Results/M416.php
Normal file
76
app/Controllers/Results/M416.php
Normal file
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
namespace App\Controllers\results;
|
||||
|
||||
use App\Controllers\BaseController;
|
||||
use App\Models\results\M416Model;
|
||||
|
||||
class M416 extends BaseController
|
||||
{
|
||||
private $model;
|
||||
public function __construct()
|
||||
{
|
||||
$this->model = new M416Model();
|
||||
}
|
||||
|
||||
public function stats(): string
|
||||
{
|
||||
|
||||
$bonbu = $this->model->getBonbuList();
|
||||
$team = $this->model->getTeamList();
|
||||
$sido = $this->model->getAreaList();
|
||||
|
||||
return view("pages/results/m416/stats", [
|
||||
'bonbu' => $bonbu,
|
||||
'team' => $team,
|
||||
'sido' => $sido,
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
public function getResultList()
|
||||
{
|
||||
$data = [
|
||||
'sdate' => $this->request->getGet('sdate'),
|
||||
'edate' => $this->request->getGet('edate'),
|
||||
'bonbu' => $this->request->getGet('bonbu'),
|
||||
'dept_sq' => $this->request->getGet('dept_sq'),
|
||||
'srchType' => $this->request->getGet('srchType'),
|
||||
'srchTxt' => $this->request->getGet('srchTxt'),
|
||||
];
|
||||
|
||||
$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'),
|
||||
'bonbu' => $this->request->getGet('bonbu'),
|
||||
'dept_sq' => $this->request->getGet('dept_sq'),
|
||||
'srchType' => $this->request->getGet('srchType'),
|
||||
'srchTxt' => $this->request->getGet('srchTxt'),
|
||||
];
|
||||
|
||||
$datas = $this->model->getResultList($data);
|
||||
|
||||
return $this->response->setJSON(body: [
|
||||
'data' => $datas,
|
||||
]);
|
||||
|
||||
} catch (\Exception $e) {
|
||||
$e->getPrevious()->getTraceAsString();
|
||||
}
|
||||
}
|
||||
}
|
||||
69
app/Controllers/Results/M417.php
Normal file
69
app/Controllers/Results/M417.php
Normal file
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
namespace App\Controllers\results;
|
||||
|
||||
use App\Controllers\BaseController;
|
||||
use App\Models\results\M417Model;
|
||||
|
||||
|
||||
class M417 extends BaseController
|
||||
{
|
||||
private $model;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->model = new M417Model();
|
||||
}
|
||||
|
||||
public function stats(): string
|
||||
{
|
||||
$department = $this->model->getDepart();
|
||||
|
||||
return view("pages/results/m417/stats", [
|
||||
'department' => $department,
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
public function getResultList()
|
||||
{
|
||||
$data = [
|
||||
'sdate' => $this->request->getGet('sdate'),
|
||||
'edate' => $this->request->getGet('edate'),
|
||||
'dept_sq' => $this->request->getGet(index: 'dept_sq'),
|
||||
];
|
||||
|
||||
$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'),
|
||||
'dept_sq' => $this->request->getGet(index: 'dept_sq'),
|
||||
];
|
||||
|
||||
$datas = $this->model->getResultList($data);
|
||||
|
||||
return $this->response->setJSON(body: [
|
||||
'data' => $datas,
|
||||
]);
|
||||
|
||||
} catch (\Exception $e) {
|
||||
$e->getPrevious()->getTraceAsString();
|
||||
}
|
||||
}
|
||||
}
|
||||
87
app/Controllers/Results/Person.php
Normal file
87
app/Controllers/Results/Person.php
Normal file
@@ -0,0 +1,87 @@
|
||||
<?php
|
||||
namespace App\Controllers\results;
|
||||
|
||||
use App\Controllers\BaseController;
|
||||
use App\Models\results\PersonModel;
|
||||
|
||||
class Person extends BaseController
|
||||
{
|
||||
private $personModel;
|
||||
public function __construct()
|
||||
{
|
||||
$this->personModel = new PersonModel();
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
}
|
||||
|
||||
public function lists(): string
|
||||
{
|
||||
$bonbu = $this->personModel->getBonbuList();
|
||||
$team = $this->personModel->getTeamList();
|
||||
$sido = $this->personModel->getAreaList();
|
||||
|
||||
return view("pages/results/person/stats_p01", [
|
||||
'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->personModel->getTotalCount($data);
|
||||
|
||||
|
||||
$datas = $this->personModel->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->personModel->getExcelUserList($data);
|
||||
|
||||
return $this->response->setJSON(body: [
|
||||
'data' => $datas,
|
||||
]);
|
||||
|
||||
} catch (\Exception $e) {
|
||||
$e->getPrevious()->getTraceAsString();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
99
app/Controllers/Results/Summary.php
Normal file
99
app/Controllers/Results/Summary.php
Normal file
@@ -0,0 +1,99 @@
|
||||
<?php
|
||||
namespace App\Controllers\results;
|
||||
|
||||
use App\Controllers\BaseController;
|
||||
use App\Models\results\SummaryModel;
|
||||
|
||||
class Summary extends BaseController
|
||||
{
|
||||
private $summaryModel;
|
||||
|
||||
private $schDateGb = ''; // 일자구분
|
||||
private $sdate = ''; // 시작일자
|
||||
private $edate = ''; // 종료일자
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->summaryModel = new SummaryModel();
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$this->schDateGb = $this->request->getPost('schDateGb') ?? '1';
|
||||
$this->sdate = $this->request->getPost('sdate') ?? date('Y-m-d', strtotime('first day of this month'));
|
||||
$this->edate = $this->request->getPost('edate') ?? date('Y-m-d', strtotime('last day of this month'));
|
||||
}
|
||||
|
||||
|
||||
public function lists(): string
|
||||
{
|
||||
|
||||
$this->schDateGb = $this->request->getPost('schDateGb') ?? '1';
|
||||
|
||||
$this->sdate = $this->request->getPost('sdate');
|
||||
if (empty($this->sdate)) {
|
||||
$this->sdate = date('Y-m-01'); // 이번달 1일
|
||||
}
|
||||
|
||||
$this->edate = $this->request->getPost('edate');
|
||||
if (empty($this->edate)) {
|
||||
$this->edate = date('Y-m-t'); // 이번달 말일
|
||||
}
|
||||
|
||||
$data = [
|
||||
'schDateGb' => $this->schDateGb,
|
||||
'sdate' => $this->sdate,
|
||||
'edate' => $this->edate
|
||||
];
|
||||
|
||||
$res = $this->summaryModel->st_s01($data);
|
||||
$res2 = $this->summaryModel->st_s01_2($data);
|
||||
$totalAmount = 0;
|
||||
|
||||
if (!empty($res)) {
|
||||
foreach ($res as $row) {
|
||||
foreach ($row as $key => $value) {
|
||||
if (empty($value))
|
||||
$value = 0;
|
||||
|
||||
switch ($key) {
|
||||
case 'next_visit_cnt':
|
||||
$res['cost'][$key] = 8000;
|
||||
$res['amt'][$key] = $res['cost'][$key] * intval($value);
|
||||
$totalAmount += $res['amt'][$key];
|
||||
break;
|
||||
|
||||
case 'next_shoot_cnt':
|
||||
$res['cost'][$key] = 10000;
|
||||
$res['amt'][$key] = $res['cost'][$key] * intval($value);
|
||||
$totalAmount += $res['amt'][$key];
|
||||
break;
|
||||
|
||||
case 'delay_confirm_cnt':
|
||||
case 'fail_confirm_cnt':
|
||||
case 'confirm_cnt':
|
||||
$res['cost'][$key] = 13000;
|
||||
$res['amt'][$key] = $res['cost'][$key] * intval($value);
|
||||
$totalAmount += $res['amt'][$key];
|
||||
break;
|
||||
|
||||
default:
|
||||
$res['cost'][$key] = 0;
|
||||
$res['amt'][$key] = $res['cost'][$key] * intval($value);
|
||||
$totalAmount += $res['amt'][$key];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return view("pages/results/summary/stats_s01", [
|
||||
'schDateGb' => $this->schDateGb,
|
||||
'sdate' => $this->sdate,
|
||||
'edate' => $this->edate,
|
||||
'st_list' => $res,
|
||||
'st_agent' => $res2,
|
||||
'totalAmount' => $totalAmount,
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user