조회속도개선
Some checks failed
Close Pull Request / main (pull_request_target) Has been cancelled

This commit is contained in:
yangsh
2026-01-29 09:26:32 +09:00
parent d134b27614
commit 04c28d79f2

View File

@@ -142,15 +142,23 @@ class Receipt extends BaseController
// 상세화면 // 상세화면
public function detail($id) public function detail($id)
{ {
$id = (int) $id; $id = (string) $id;
if ($id <= 0) { if ($id === '') {
throw \CodeIgniter\Exceptions\PageNotFoundException::forPageNotFound(); throw \CodeIgniter\Exceptions\PageNotFoundException::forPageNotFound();
} }
$t0 = microtime(true);
$codes = $this->codeModel->getCodeLists(['TRADE_TYPE', 'RECEIPT_STATUS2', 'RECEIPT_STATUS3', 'SMS_MSG_TYPE', 'SMS_MSG_TYPE2']); // 코드조회 $codes = $this->codeModel->getCodeLists(['TRADE_TYPE', 'RECEIPT_STATUS2', 'RECEIPT_STATUS3', 'SMS_MSG_TYPE', 'SMS_MSG_TYPE2']); // 코드조회
log_message('info', '[Receipt::detail] getCodeLists {ms}ms', ['ms' => (int) ((microtime(true) - $t0) * 1000)]);
$t1 = microtime(true);
$bonbu = $this->model->getBonbuList(); $bonbu = $this->model->getBonbuList();
log_message('info', '[Receipt::detail] getBonbuList {ms}ms', ['ms' => (int) ((microtime(true) - $t1) * 1000)]);
$t2 = microtime(true);
$team = $this->model->getTeamList(); $team = $this->model->getTeamList();
log_message('info', '[Receipt::detail] getTeamList {ms}ms', ['ms' => (int) ((microtime(true) - $t2) * 1000)]);
// sms 코드 // sms 코드
$sms = []; $sms = [];
@@ -159,35 +167,57 @@ class Receipt extends BaseController
array_push($sms, $c); array_push($sms, $c);
} }
$t3 = microtime(true);
$data = $this->model->getDetail($id); $data = $this->model->getDetail($id);
$history = $this->model->getHistory($id); log_message('info', '[Receipt::detail] getDetail {ms}ms', ['ms' => (int) ((microtime(true) - $t3) * 1000)]);
$t4 = microtime(true);
$history = $this->model->getHistory($id);
log_message('info', '[Receipt::detail] getHistory {ms}ms', ['ms' => (int) ((microtime(true) - $t4) * 1000)]);
$t5 = microtime(true);
if ($data['rcpt_jibun_addr']) { if ($data['rcpt_jibun_addr']) {
$dupleGroundPlan = $this->model->getDupleGP_na($id, $data['rcpt_sido'], $data['rcpt_gugun'], $data['rcpt_dong'], $data['rcpt_hscp_nm'], $data['rcpt_dtl_addr'], $data['rcpt_li_addr'], $data['rcpt_jibun_addr'], $data['rcpt_etc_addr']); $dupleGroundPlan = $this->model->getDupleGP_na($id, $data['rcpt_sido'], $data['rcpt_gugun'], $data['rcpt_dong'], $data['rcpt_hscp_nm'], $data['rcpt_dtl_addr'], $data['rcpt_li_addr'], $data['rcpt_jibun_addr'], $data['rcpt_etc_addr']);
} else { } else {
$dupleGroundPlan = $this->model->getDupleGP($id, $data['rcpt_sido'], $data['rcpt_gugun'], $data['rcpt_dong'], $data['rcpt_hscp_nm'], $data['rcpt_dtl_addr'], $data['rcpt_ho']); $dupleGroundPlan = $this->model->getDupleGP($id, $data['rcpt_sido'], $data['rcpt_gugun'], $data['rcpt_dong'], $data['rcpt_hscp_nm'], $data['rcpt_dtl_addr'], $data['rcpt_ho']);
} }
log_message('info', '[Receipt::detail] getDupleGP {ms}ms', ['ms' => (int) ((microtime(true) - $t5) * 1000)]);
$t6 = microtime(true);
$aptGround = $this->model->getAptGround($data['rcpt_dong'] ?? ''); $aptGround = $this->model->getAptGround($data['rcpt_dong'] ?? '');
log_message('info', '[Receipt::detail] getAptGround {ms}ms', ['ms' => (int) ((microtime(true) - $t6) * 1000)]);
// 이미지 파일리스트 // 이미지 파일리스트
$t7 = microtime(true);
$images = $this->model->getImageList2($data['rsrv_sq']); $images = $this->model->getImageList2($data['rsrv_sq']);
log_message('info', '[Receipt::detail] getImageList2 {ms}ms', ['ms' => (int) ((microtime(true) - $t7) * 1000)]);
$t8 = microtime(true);
$imgs_count = $this->model->getImageCountByType($data['rsrv_sq']); $imgs_count = $this->model->getImageCountByType($data['rsrv_sq']);
log_message('info', '[Receipt::detail] getImageCountByType {ms}ms', ['ms' => (int) ((microtime(true) - $t8) * 1000)]);
$imgs_count = convertArrayToHashTable($imgs_count, 'img_type', 'img_cnt'); $imgs_count = convertArrayToHashTable($imgs_count, 'img_type', 'img_cnt');
//녹취파일 //녹취파일
$t9 = microtime(true);
$record = $this->model->getRecordInfo($data['rsrv_sq']); $record = $this->model->getRecordInfo($data['rsrv_sq']);
log_message('info', '[Receipt::detail] getRecordInfo {ms}ms', ['ms' => (int) ((microtime(true) - $t9) * 1000)]);
// 시간대별통계 // 시간대별통계
$t10 = microtime(true);
$tmCount = $this->model->getUsrRsrvDateTmCount($id); $tmCount = $this->model->getUsrRsrvDateTmCount($id);
log_message('info', '[Receipt::detail] getUsrRsrvDateTmCount {ms}ms', ['ms' => (int) ((microtime(true) - $t10) * 1000)]);
// 체크리스트 조회 // 체크리스트 조회
$t11 = microtime(true);
if ($data['exp_photo_yn'] === "N") { if ($data['exp_photo_yn'] === "N") {
$result_check = $this->model->getChecklist($data['rsrv_sq']); $result_check = $this->model->getChecklist($data['rsrv_sq']);
} else { } else {
$result_check = []; $result_check = [];
} }
log_message('info', '[Receipt::detail] getChecklist {ms}ms', ['ms' => (int) ((microtime(true) - $t11) * 1000)]);
log_message('info', '[Receipt::detail] total {ms}ms', ['ms' => (int) ((microtime(true) - $t0) * 1000)]);
$this->data['codes'] = $codes; $this->data['codes'] = $codes;
$this->data['bonbu'] = $bonbu; $this->data['bonbu'] = $bonbu;