diff --git a/app/Config/Routes.php b/app/Config/Routes.php index afa34f1..67b2f01 100644 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -61,6 +61,7 @@ $routes->group('', ['namespace' => 'App\Controllers\Article'], static function ( */ $routes->group('article', static function ($routes) { $routes->get('receipt/lists', 'Receipt::lists'); + $routes->get('receipt/detail/(:num)', 'Receipt::detail/$1'); $routes->get('receipt/getResultList', 'Receipt::getResultList'); diff --git a/app/Controllers/Article/Receipt.php b/app/Controllers/Article/Receipt.php index ad174ae..a7f6746 100644 --- a/app/Controllers/Article/Receipt.php +++ b/app/Controllers/Article/Receipt.php @@ -135,4 +135,42 @@ class Receipt extends BaseController $e->getPrevious()->getTraceAsString(); } } + + + // 상세화면 + public function detail($id) + { + $id = (int) $id; + + if ($id <= 0) { + throw \CodeIgniter\Exceptions\PageNotFoundException::forPageNotFound(); + } + + $codes = $this->codeModel->getCodeLists(['TRADE_TYPE', 'RECEIPT_STATUS2', 'RECEIPT_STATUS3', 'SMS_MSG_TYPE']); // 코드조회 + $bonbu = $this->model->getBonbuList(); + $team = $this->model->getTeamList(); + + $data = $this->model->getDetail($id); + $history = $this->model->getHistory($id); + + $aptGround = $this->model->getAptGround($data['rcpt_dong']); + + + // 시간대별통계 + $tmCount = $this->model->getUsrRsrvDateTmCount($id); + + $this->data['codes'] = $codes; + $this->data['bonbu'] = $bonbu; + $this->data['team'] = $team; + + $this->data['data'] = $data; + $this->data['history'] = $history; + + $this->data['apt_ground'] = $aptGround; + + $this->data['tmCount'] = $tmCount; + + + return view("pages/article/receipt/detail", $this->data); + } } \ No newline at end of file diff --git a/app/Models/article/ReceiptModel.php b/app/Models/article/ReceiptModel.php index 86c2fef..dd50721 100644 --- a/app/Models/article/ReceiptModel.php +++ b/app/Models/article/ReceiptModel.php @@ -971,4 +971,253 @@ class ReceiptModel extends Model return $builder->get()->getResultArray(); } + + // 상세 + public function getDetail($id) + { + + $builder = $this->db->table('receipt a'); + + $builder->select(" + a.rcpt_sq + ,a.comp_sq + ,a.excls_spc + ,a.rcpt_rating + ,a.rcpt_key + ,a.rcpt_atclno + ,a.rcpt_type + ,a.rcpt_product + ,a.rcpt_product_nm + ,a.rcpt_product_area + ,a.rcpt_product_price + , a.rcpt_deal_type + ,a.rcpt_product_info1 + ,a.rcpt_product_info2 + ,a.rcpt_product_info3 + ,a.rcpt_product_info4 + ,a.rcpt_product_info5 + ,a.rcpt_office + ,(CASE WHEN a.rcpt_agent IS NULL THEN 'N' ELSE 'Y' END) as rcpt_agent + ,a.rcpt_sido + ,a.rcpt_gugun + ,a.rcpt_dong + ,a.rcpt_dtl_addr + ,a.rcpt_li_addr + ,a.rcpt_jibun_addr + ,a.rcpt_etc_addr + ,a.rcpt_ref_addr + ,a.rcpt_ho + ,a.rcpt_hscp_nm + ,a.rcpt_floor + ,a.rcpt_floor2 + ,a.chg_floor_yn + ,a.rcpt_tm + ,a.rcpt_stat + ,a.rcpt_x + ,a.rcpt_y + ,a.rcpt_living_yn + ,a.cust_nm + ,a.cust_tel1 + ,a.cust_tel2 + ,a.cust_zip + ,a.cust_addr1 + ,a.cust_addr2 + ,a.remark rcpt_remark + , a.rcpt_cpid + ,a.agent_id + ,a.agent_nm + ,a.agent_head + ,a.agent_head_tel + ,a.agent_contact + ,a.agent_contact_tel + ,a.agent_fax + ,a.agent_tel + ,a.excls_spc + ,a.excls_spc1 + ,a.excls_spc2 + ,a.sply_spc + ,a.share_spc + ,a.share_spc1 + ,a.share_spc2 + ,a.share_spc3 + ,a.share_spc4 + ,a.share_spc5 + ,a.room_cnt + ,a.tot_spc + ,a.tot_spc1 + ,a.tot_spc2 + ,a.grnd_spc + ,a.grnd_spc1 + ,a.grnd_spc2 + ,a.grnd_spc3 + ,a.grnd_spc4 + ,a.grnd_spc5 + ,a.spc_stat + ,a.exp_spc_yn + ,DATE_FORMAT(COALESCE(b.rsrv_date, a.rsrv_date), '%Y-%m-%d') AS rsrv_date + ,COALESCE(b.rsrv_tm_ap, a.rsrv_tm_ap) as rsrv_tm_ap + ,a.insert_usr + ,a.insert_tm + ,a.update_usr + ,a.update_tm + ,a.svc_type1 + ,a.svc_type2 + ,a.reconf_yn + ,a.cupnNo + ,b.rsrv_sq + ,b.dept_sq + ,b.usr_sq + ,b.req_rec_yn + ,b.rec_yn + ,b.rec_tel + ,b.rec_nm + ,b.remark + ,b.rsrv_tm_hour + ,b.result_cd1 + ,get_code_name('RECEIPT_STATUS1', b.result_cd1) AS result_cd1_nm + ,b.result_cd2 + ,get_code_name('RECEIPT_STATUS2', b.result_cd2) AS result_cd2_nm + ,b.result_cd3 + ,get_code_name('RECEIPT_STATUS3', b.result_cd3) AS result_cd3_nm + ,b.result_msg + ,b.rsrv_save_dt + ,b.photo_save_dt + ,DATE_FORMAT(b.photo_save_dt, '%Y-%m-%d') as photo_save_dt_dt + ,DATE_FORMAT(b.photo_save_dt, '%H:%i:%s') as photo_save_dt_tm + ,b.assign_save_dt + ,b.result_save_dt + ,b.request_msg + ,b.rsrv_delay_dt + ,DATE_FORMAT(b.rsrv_delay_dt, '%Y-%m-%d') as rsrv_delay_dt_dt + ,DATE_FORMAT(b.rsrv_delay_dt, '%H:%i:%s') as rsrv_delay_dt_tm + ,b.rsrv_cplt_dt + ,DATE_FORMAT(b.rsrv_cplt_dt, '%Y-%m-%d') as rsrv_cplt_dt_dt + ,DATE_FORMAT(b.rsrv_cplt_dt, '%H:%i:%s') as rsrv_cplt_dt_tm + ,b.check_dt + ,DATE_FORMAT(b.check_dt, '%Y-%m-%d') as check_dt_dt + ,DATE_FORMAT(b.check_dt, '%H:%i:%s') as check_dt_tm + ,b.check_cplt_dt + ,DATE_FORMAT(b.check_cplt_dt, '%Y-%m-%d') as check_cplt_dt_dt + ,DATE_FORMAT(b.check_cplt_dt, '%H:%i:%s') as check_cplt_dt_tm + ,b.cancel_dt + ,DATE_FORMAT(b.cancel_dt, '%Y-%m-%d') as cancel_dt_dt + ,DATE_FORMAT(b.cancel_dt, '%H:%i:%s') as cancel_dt_tm + ,b.check_delay_dt + ,DATE_FORMAT(b.check_delay_dt, '%Y-%m-%d') as check_delay_dt_dt + ,DATE_FORMAT(b.check_delay_dt, '%H:%i:%s') as check_delay_dt_tm + ,b.check_fail_dt + ,DATE_FORMAT(b.check_fail_dt, '%Y-%m-%d') as check_fail_dt_dt + ,DATE_FORMAT(b.check_fail_dt, '%H:%i:%s') as check_fail_dt_tm + ,get_code_name('RECEIPT_STATUS3', a.rcpt_stat) AS rcpt_stat_nm + ,DATE_FORMAT(a.insert_tm, '%Y년 %m월 %d일') as insert_tm2 + ,DATE_FORMAT(a.rsrv_date, '%Y-%m-%d') as rsrv_date2 + ,c.region_nm as addr + ,c.dept_sq as region_dept_sq + ,c.usr_sq as region_usr_sq + ,d.pdept_sq + ,d.dept_nm + ,a.rcpt_exps_type + ,a.exp_photo_yn + ,a.exp_movie_yn + ,b.resYn + ,DATE_ADD(a.insert_tm, INTERVAL +3 MONTH) as months + ,b.dbUsageAgrYn + ,a.trade_type + , a.rcpt_hscp_no + , a.rcpt_ptp_nm + , a.rcpt_ptp_no + , a.modify_yn + , a.ground_plan + ,a.direct_trad_yn + ,a.sellr_nm + ,a.sellr_tel_no + ,a.virAddr_yn + ,a.isSiteVRVerification + ,a.isPromotionApply + ,DATE_FORMAT(b.vr_check_cplt_dt, '%Y-%m-%d') as vr_check_cplt_dt_dt + ,DATE_FORMAT(b.vr_check_cplt_dt, '%H:%i:%s') as vr_check_cplt_dt_dm + ", false); + + $builder->join('result b', 'b.rcpt_sq = a.rcpt_sq', 'inner'); + $builder->join('region_codes c', 'a.rcpt_dong = c.region_cd', 'inner'); + $builder->join('departments d', 'b.dept_sq = d.dept_sq', 'left'); + + + $builder->where('a.rcpt_key', $id); + + + return $builder->get()->getRowArray(); + } + + // 정보변경이력 + public function getHistory($id) + { + $sql = "SELECT seq" . + " ,rcpt_sq" . + " ,rcpt_stat" . + " ,get_code_name('RECEIPT_STATUS3', rcpt_stat) AS rcpt_stat_nm" . + " ,rcpt_stat" . + " ,get_code_name('CHANGED_TYPE', changed_type) AS changed_type_nm" . + " ,changed_type" . + " ,changed_id" . + " ,remark" . + " ,DATE_FORMAT(changed_tm, '%Y.%m.%d %H:%i:%s') as changed_tm" . + " FROM changed_history" . + " WHERE rcpt_sq = ?" . + " ORDER BY changed_tm DESC"; + + $data = [$id]; + $query = $this->db->query($sql, $data); + + return $query->getResultArray(); + } + + public function getAptGround($rcpt_dong) + { + + $sql = "SELECT "; + $sql .= "* "; + $sql .= "FROM apt_ground "; + $sql .= "WHERE region_cd = ? "; + + $data = [$rcpt_dong]; + + $query = $this->db->query($sql, $data); + + return $query->getResultArray(); + + } + + // 시간대별통계 + public function getUsrRsrvDateTmCount($id) + { + $sql = "SELECT b.usr_sq, b.rsrv_date FROM receipt a INNER JOIN result b ON a.rcpt_sq = b.rcpt_sq WHERE a.rcpt_key = ?"; + $data = [$id]; + $query = $this->db->query($sql, $data); + $row = $query->getRowArray(); + + if (!empty($row['usr_sq'])) { + $sql2 = "SELECT usr_sq, rsrv_tm_ap, rsrv_tm_hour, COUNT(rsrv_tm_hour) as cnt" . + " FROM result" . + " WHERE rsrv_date = ?" . + " AND usr_sq = ?" . + " GROUP BY usr_sq, rsrv_tm_ap, rsrv_tm_hour" . + " ORDER BY rsrv_tm_ap, rsrv_tm_hour"; + + $data2 = [$row['rsrv_date'], $row['usr_sq']]; + } else { + $sql2 = "SELECT usr_sq, rsrv_tm_ap, rsrv_tm_hour, COUNT(rsrv_tm_hour) as cnt" . + " FROM result" . + " WHERE rsrv_date = ?" . + " AND usr_sq = (SELECT b.usr_sq FROM receipt a, region_codes b WHERE a.rcpt_dong = b.region_cd AND a.rcpt_key = ?)" . + " GROUP BY usr_sq, rsrv_tm_ap, rsrv_tm_hour" . + " ORDER BY rsrv_tm_ap, rsrv_tm_hour"; + + $data2 = [$row['rsrv_date'], $id]; + } + + $query2 = $this->db->query($sql2, $data2); + + return $query2->getResultArray(); + } } \ No newline at end of file diff --git a/app/Views/pages/article/receipt/detail.php b/app/Views/pages/article/receipt/detail.php new file mode 100644 index 0000000..dd95c01 --- /dev/null +++ b/app/Views/pages/article/receipt/detail.php @@ -0,0 +1,1331 @@ + +extend('layouts/main') ?> +section('content') ?> + + + +
+
+
+
현장확인매물 상세 내용
+
+
+
+ +
+
+ +
+
+ + + + + + + + + + + +
+ 매물ID : + + + CP ID : + +
+
+ +
+
공인 중개사 정보
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
중개사ID중개사명
대표전화담당자전화
검증방식 + 현장V2" + : "현장"; ?> + 연락가능전화 + +
+ + +
+
+ +
+
+ + +
+
+
매물 정보
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 지하층 / 지상층"); + } else if (in_array($data['rcpt_product'], $chk_product_nm)) { + echo (""); + } else { + echo (""); + } + ?> + + + + + + + + + +
등록일 + + 예약(촬영)요청일 + + + +
현장확인(촬영)일자 + + 가주소 여부 + 가주소 + +
매물구분거래구분 + +
지역구분 + + 리 주소 + +
+
상세주소 + + + +
+ + + + + +
+ + + +
기타주소 + +
단지명가격 + + + +
+
+ + 만원 +
+ + +
+
+ + 만원 (월) +
+
+ + + +
+ 분양가 + + 만원 + + / + + 프리미엄 + + 만원 +
+ + + +
+ + +
+
+
평형지하층 / 지상층층 / 총층 + + +
지도좌표 +
+ + +
+
+ 경도 + +
+ +
+ 위도 + +
+
+ + +
+ + + +
+ +
+
+ + + +
+ +
+
+ + +
+
+
거주여부
+ + + + + + + + + + +
거주여부 + + +
DB활용동의여부
+
+
+ +
+
+ +
+
+
+ + +
+
+
평면도요청
+ + + + + + + + + + +
+
평면도요청
+
+ + 평면도 등록 여부 + 0) { + echo "Y"; + } else { + echo "N"; + } + ?> + + +
+
+
+ + +
+
+
예약확정
+ + + + + + + + + + + + + + + + + + + +
방문희망일시 + + + +
방문날짜 + + + + 담당자 + + + +
+
+ +
+ + +
+
+
동영상촬영여부
+ + + + + + + + +
+ 동영상촬영여부 + + + + +
+
+
+ + +
+
+
중개인 요청사항
+ + + + + + + + +
+ 중개인 요청사항 + + + + +
+
+
+ + +
+
+
+ 담당자 예약현황 () +
+ + + + + + + + + + + + + + + + + +
+ + 시 +
+
+
+ + +
+
+
취소
+ + + + + + + + + + +
+
취소
+
+ + + 취소사유 + + + +
+
+
+ + +
+
+
매물 상태 정보 + + + +
+ + " . $data['rsrv_delay_dt_tm']; //예약지연 + $stat2 = $data['rsrv_cplt_dt_dt'] . "
" . $data['rsrv_cplt_dt_tm']; //에약확인 + if ($data['req_rec_yn'] == "Y") { //촬영 + $stat3 = $data['photo_save_dt_dt'] . "
" . $data['photo_save_dt_tm'] . "
녹취필요"; + } else { + $stat3 = $data['photo_save_dt_dt'] . "
" . $data['photo_save_dt_tm']; + } + $stat4 = $data['check_delay_dt_dt'] . "
" . $data['check_delay_dt_tm']; //검수지연 + $stat5 = $data['check_fail_dt_dt'] . "
" . $data['check_fail_dt_tm']; //검수실패 + $stat6 = $data['check_dt_dt'] . "
" . $data['check_dt_tm']; //검수 + $stat7 = $data['check_cplt_dt_dt'] . "
" . $data['check_cplt_dt_tm']; //검수완료 + $stat8 = $data['cancel_dt_dt'] . "
" . $data['cancel_dt_tm']; //취소 + + $currStat = substr($data['rcpt_stat'], 0, 2); + $currStat2 = substr($data['rcpt_stat'], 2, 2); + + if ($currStat == 15) { //예약지연 + $stat1 = "" . $stat1 . ""; + } else if ($currStat == 20) { //예약확인 + $stat2 = "" . $stat2 . ""; + } else if ($currStat == 40) { //촬영 + $stat3 = "" . $stat3 . ""; + } else if ($currStat == 50) { //검수 + $stat6 = "" . $stat6 . ""; + } else if ($currStat == 60) { //검수완료 + $stat7 = "" . $stat7 . ""; + } else if ($currStat == 70) { //검수지연 + $stat4 = "" . $stat4 . "
" . $data['rcpt_stat_nm'] . "
"; + } + if ($currStat == 90 && $currStat2 != 50) { //취소 + $stat8 = "" . $stat8 . "
" . $data['result_cd2_nm'] . "
"; + } else if ($currStat == 90 && $currStat2 == 50) { //검수실패 + $stat5 = "" . $stat5 . "
" . $data['rcpt_stat_nm'] . "
"; + } + ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
현장확인
진행상황
예약지연예약확인촬영검수지연검수실패검수검수완료취소
+ + + + + + + + + + + + + + + +
상태변경 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+
+
SMS 보내기
+ + + + + + + "; + } + $smsCnt++; + endforeach; ?> + +
+ 상황별
SMS선택 +
+ + + +
+
+
+ + +
+
+
매물 위치
+ + + + + + + + +
+
+
+
+
+ + +
+
+
확인 정보 및 사진 정보
+
+ + +
+
+
+
홍보확인서
+ + + +
+ +
+ 홍보확인서 +
+
+
+ + +
+
+
+
촬영동의서
+ +
+ +
+ 촬영동의서 +
+
+
+ + +
+
+
+
현장확인내역서
+ +
+ +
+ 현장확인내역서 +
+
+
+
+ +
+ + +
+
+
분양권 (최대 5장)
+ +
+ +
+ +
+ 분양권1 +
+
+
+ +
+ + +
+
+
매물사진 (최대 15장)
+ +
+ + + + +
+
+ +
+ + +
+ +
+ 매물사진 +
+
+ +
+
+ +
+ + +
+
+
+
+
동영상
+ +
+
+ 동영상 +
+
+
+ +
+
+
+
평면도
+ +
+
+ 평면도 +
+
+
+ +
+
+
+
체크리스트
+ +
+
+ 체크리스트 +
+
+
+
+ + +
+
검수사항
+
+ + +
+ +
+ + +
+ +
+ + +
+
+
360이미지 / 촬영위치
+ +
+ +
+ +
+
+ 360이미지 +
+ +
+ +
+
+ 360이미지 +
+ +
+ +
+
+ 360이미지 +
+ +
+ + +
+
+
+
+ + + +
+
+
중개인 요청사항
+ + + + + + + + + + + + + + + + + + + + + + + +
거주자 전화번호거주인 이름
음성파일 +
+ + + + + +
+ + +
+ +
+
거주인 요청사항 + +
+
+
+ + +
+
+
정보변경 이력
+
+ + + + + + + + + + + + + + + + + + + +
진행상태변경내용처리자(ID)처리일시세부내용
+ + + + + + + + + +
+
+
+
+ +
+
+ + + + +endSection() ?> \ No newline at end of file diff --git a/app/Views/pages/article/receipt/lists.php b/app/Views/pages/article/receipt/lists.php index 59c0a83..1866b12 100644 --- a/app/Views/pages/article/receipt/lists.php +++ b/app/Views/pages/article/receipt/lists.php @@ -636,7 +636,7 @@ $usr_nm = session('usr_nm'); { data: null, render: fn_prd_render }, { data: 'rcpt_product_info1' }, - { data: 'dept_nm' }, + { data: 'dept_nm' }, { data: 'usr_nm' }, { data: 'parcel_out_yn' }, @@ -657,6 +657,17 @@ $usr_nm = session('usr_nm'); ordering: false, }); + // 테이블 row click + $('#resultList tbody').on('click', 'tr', function (e) { + if ($(e.target).closest('td.dt-no-rowclick').length) return; + + const rowData = table.row(this).data(); + if (!rowData) return; + + const rcpt_atclno = rowData.rcpt_atclno; + location.href = "/" + rcpt_atclno; + }); + // 엑셀 다운로드 click $("#excel-download").on("click", function () {