diff --git a/app/Config/Routes.php b/app/Config/Routes.php
index dcf83f8..215d773 100644
--- a/app/Config/Routes.php
+++ b/app/Config/Routes.php
@@ -102,6 +102,7 @@ $routes->group('', ['namespace' => 'App\Controllers\V2'], static function ($rout
* 홍보확인서현황 - API
*/
$routes->get('m703a/getResultList', 'M703::getResultList');
+ $routes->get('m703a/excel', 'M703::excel');
$routes->post('m703a/saveBunyang', 'M703::saveBunyang'); // 현장확인저장
$routes->post('m703a/saveOthers', 'M703::saveOthers'); // 홍보확인서아님
$routes->post('m703a/saveDuplicate', 'M703::saveDuplicate'); // 중복
@@ -112,6 +113,23 @@ $routes->group('', ['namespace' => 'App\Controllers\V2'], static function ($rout
$routes->post('m703a/saveResult', 'M703::saveResult'); // 결과저장
});
+ /**
+ * 전화확인매물현황
+ */
+ $routes->group('m704', static function ($routes) {
+ $routes->get('m704a/lists', 'M704::lists');
+ $routes->get('m704a/detail/(:num)', 'M704::detail/$1');
+
+ /**
+ * 전화확인매물현황 - API
+ */
+ $routes->get('m704a/getResultList', 'M704::getResultList');
+ $routes->get('m704a/excel', 'M704::excel');
+ $routes->post('m704a/uploadFile', 'M704::uploadFile'); // 파일업로드
+ $routes->post('m704a/saveMemo', 'M704::saveMemo'); // 메모저장
+ $routes->post('m704a/getNextFaxImgs', 'M704::getNextFaxImgs'); // 다음매물확인
+ });
+
});
diff --git a/app/Controllers/V2/M704.php b/app/Controllers/V2/M704.php
new file mode 100644
index 0000000..93f2bcd
--- /dev/null
+++ b/app/Controllers/V2/M704.php
@@ -0,0 +1,282 @@
+model = new M704Model();
+ $this->codeModel = new CodeModel();
+ }
+
+ public function lists(): string
+ {
+ $codes = $this->codeModel->getCodeLists(['STEP_VERIFICATION', 'VRFCREQ_WAY', 'CP_ID', 'TEL_FAIL_CAUSE', 'ARTICLE_TYPE']); // 코드조회
+ $sido = $this->model->getAreaList(); // 지역조회
+ $bonbu = $this->model->getBonbuList();
+ $team = $this->model->getTeamList();
+ $user = $this->model->getUserList();
+
+ $this->data['sido'] = $sido;
+ $this->data['bonbu'] = $bonbu;
+ $this->data['team'] = $team;
+ $this->data['user'] = $user;
+ $this->data['codes'] = $codes;
+
+ return view("pages/v2/m704/lists", $this->data);
+ }
+
+
+ public function getResultList()
+ {
+ $start = (int) $this->request->getGet('start') ?: 0;
+ $end = (int) $this->request->getGet('length') ?: 10;
+
+ $data = [
+ 'atcl_no' => $this->request->getGet('atcl_no'), // 매물번호
+ 'stat_cd' => $this->request->getGet('stat_cd'), // 현재상태
+ 'realtor_nm' => $this->request->getGet('realtor_nm'), // 중개소
+ 'charger_gbn' => $this->request->getGet('charger_gbn'), // 배정여부
+ 'assign_yn' => $this->request->getGet('assign_yn'), // 배정여부2
+ 'receipt_sdate' => $this->request->getGet('receipt_sdate'), // 접수기간1
+ 'receipt_edate' => $this->request->getGet('receipt_edate'), // 접수기간2
+ 'stat_complete_date' => $this->request->getGet('stat_complete_date'), // 진행상태별시간유형
+ 'complete_sdate' => $this->request->getGet('complete_sdate'), // 진행상태별시간1
+ 'complete_edate' => $this->request->getGet('complete_edate'), // 진행상태별시간2
+ 'srcSido' => $this->request->getGet('srcSido'), // 시도
+ 'srcGugun' => $this->request->getGet('srcGugun'), // 시군구
+ 'srcDong' => $this->request->getGet('srcDong'), // 읍면동
+ 'bonbu' => $this->request->getGet('bonbu'), // 본부
+ 'team' => $this->request->getGet('team'), // 팀
+ 'damdang' => $this->request->getGet('damdang'), // 담당
+ 'vrfcreq_way' => $this->request->getGet('vrfcreq_way'), // 검증방식1
+ 'vrfc_type_sub' => $this->request->getGet('vrfc_type_sub'), // 검증방식2
+ 'rcpt_cpid' => $this->request->getGet('rcpt_cpid'), // 매체사
+ 'rlet_type_cd' => $this->request->getGet('rlet_type_cd'), // 매물종류
+ 'reference_file_url_yn' => $this->request->getGet('reference_file_url_yn'), // 참고용
+ 'corp_own' => $this->request->getGet('corp_own'), // 법인
+ ];
+
+ $totalCount = $this->model->getTotalCount($data);
+
+
+ $datas = $this->model->getResultList($start, $end, $data);
+
+ return $this->response->setJSON(body: [
+ 'recordsTotal' => $totalCount,
+ 'recordsFiltered' => $totalCount,
+ 'data' => $datas,
+ ]);
+ }
+
+ // 엑셀 다운로드
+ public function excel()
+ {
+ try {
+
+ $data = [
+ 'atcl_no' => $this->request->getGet('atcl_no'), // 매물번호
+ 'stat_cd' => $this->request->getGet('stat_cd'), // 현재상태
+ 'realtor_nm' => $this->request->getGet('realtor_nm'), // 중개소
+ 'charger_gbn' => $this->request->getGet('charger_gbn'), // 배정여부
+ 'assign_yn' => $this->request->getGet('assign_yn'), // 배정여부2
+ 'receipt_sdate' => $this->request->getGet('receipt_sdate'), // 접수기간1
+ 'receipt_edate' => $this->request->getGet('receipt_edate'), // 접수기간2
+ 'stat_complete_date' => $this->request->getGet('stat_complete_date'), // 진행상태별시간유형
+ 'complete_sdate' => $this->request->getGet('complete_sdate'), // 진행상태별시간1
+ 'complete_edate' => $this->request->getGet('complete_edate'), // 진행상태별시간2
+ 'srcSido' => $this->request->getGet('srcSido'), // 시도
+ 'srcGugun' => $this->request->getGet('srcGugun'), // 시군구
+ 'srcDong' => $this->request->getGet('srcDong'), // 읍면동
+ 'bonbu' => $this->request->getGet('bonbu'), // 본부
+ 'team' => $this->request->getGet('team'), // 팀
+ 'damdang' => $this->request->getGet('damdang'), // 담당
+ 'vrfcreq_way' => $this->request->getGet('vrfcreq_way'), // 검증방식1
+ 'vrfc_type_sub' => $this->request->getGet('vrfc_type_sub'), // 검증방식2
+ 'rcpt_cpid' => $this->request->getGet('rcpt_cpid'), // 매체사
+ 'rlet_type_cd' => $this->request->getGet('rlet_type_cd'), // 매물종류
+ 'reference_file_url_yn' => $this->request->getGet('reference_file_url_yn'), // 참고용
+ 'corp_own' => $this->request->getGet('corp_own'), // 법인
+ ];
+
+ $datas = $this->model->getExcelList($data);
+
+ return $this->response->setJSON(body: [
+ 'data' => $datas,
+ ]);
+
+ } catch (\Exception $e) {
+ $e->getPrevious()->getTraceAsString();
+ }
+ }
+
+
+ // 상세화면
+ public function detail($id)
+ {
+ $id = (int) $id;
+
+ if ($id <= 0) {
+ throw \CodeIgniter\Exceptions\PageNotFoundException::forPageNotFound();
+ }
+
+ $codes = $this->codeModel->getCodeLists(['VRFCREQ_WAY', 'CONFIRM_RESULT_D11', 'CONFIRM_RESULT_T11', 'TEL_FAIL_CAUSE']); // 코드조회
+
+ $data = $this->model->getDetail($id);
+ $memo = $this->model->getMemo($id);
+ $history = $this->model->getHistory($id);
+
+ $regist2 = $this->model->oneGetRecordInfo($id, "2"); //등기부등본
+ $phone_list = $this->model->getPhoneNumber(); // 주택임대사업자번호 리스트
+ $tel = $this->model->getRecordInfo($id, '3'); //녹취파일
+
+ $this->data['codes'] = $codes;
+
+ $this->data['data'] = $data;
+ $this->data['memo'] = $memo;
+ $this->data['history'] = $history;
+ $this->data['regist2'] = $regist2;
+ $this->data['phone_list'] = $phone_list;
+ $this->data['tel'] = $tel;
+
+ return view("pages/v2/m704/detail", $this->data);
+ }
+
+ // 파일업로드
+ public function uploadFile()
+ {
+ $lib = new MyUpload();
+
+ try {
+ $usr_id = session('usr_id');
+ $vr_sq = $this->request->getPost('vr_sq');
+
+ $file = $this->request->getFile('file');
+
+ if ($file && $file->isValid() && !$file->hasMoved()) {
+
+ $uploadPath = "/upload/v2_file/multi_" . $vr_sq . "/";
+
+ $arrUploadfile = [];
+ if ($file->isValid() && !$file->hasMoved()) {
+ $uploadData = $lib->do_upload2($file, $uploadPath);
+
+ if ($uploadData !== false) {
+ $arrUploadfile[] = $uploadData;
+ }
+ }
+
+ if (!empty($arrUploadfile)) {
+ foreach ($arrUploadfile as $key => $uploadFile) {
+ $data = [
+ 'vr_sq' => $vr_sq,
+ // 'file_sq' => $this->request->getPost('file_sq'),
+ 'orig_name' => $uploadFile['origin_name'],
+ 'new_name' => $uploadFile['file_name'],
+ 'file_path' => $uploadPath, // 필요에 따라 상대경로로만 저장
+ 'ext' => '.' . $uploadFile['ext'],
+ 'size' => $file->getSize(),
+ 'img_yn' => null,
+ 'img_height' => null,
+ 'img_width' => null,
+ 'usr_id' => $usr_id,
+ ];
+ }
+
+ if (!empty($data)) {
+ // 파일업로드 이력 저장
+ $this->model->saveChangedHistory($vr_sq, '30', 'C26', $usr_id, '녹취파일 업로드');
+
+ // 파일업로드 정보 저장
+ $this->model->saveFileInfo($data);
+
+ }
+
+ }
+
+ }
+
+
+ return $this->response->setJSON([
+ 'code' => '0',
+ 'msg' => 'success'
+ ]);
+
+
+ } catch (\Exception $e) {
+ return $this->response->setJSON([
+ 'code' => '9',
+ 'msg' => $e->getMessage(),
+ ]);
+ }
+ }
+
+
+ // 메모저장
+ public function saveMemo()
+ {
+ try {
+
+ $vr_sq = $this->request->getPost('vr_sq');
+ $memo = $this->request->getPost('memo');
+
+ $data = [
+ $memo,
+ $vr_sq,
+ ];
+
+ // UPDATE v2_vrfc_req
+ $this->model->saveMemo($data);
+
+ return $this->response->setJSON([
+ 'code' => '0',
+ 'msg' => 'success'
+ ]);
+
+ } catch (\Exception $e) {
+ return $this->response->setJSON([
+ 'code' => '9',
+ 'msg' => $e->getMessage(),
+ ]);
+ }
+ }
+
+
+ // 다음 매물정보 조회
+ public function getNextTelInfo()
+ {
+ try {
+
+ $vr_sq = $this->request->getPost('vr_sq');
+
+ $data = $this->model->getNextTelInfo($vr_sq);
+
+ if (empty($data)) {
+ return $this->response->setJSON([
+ 'code' => '9',
+ 'msg' => '전화매물이 존재하지 않습니다.'
+ ]);
+ } else {
+ return $this->response->setJSON([
+ 'code' => '0',
+ 'msg' => 'success',
+ 'data' => $data
+ ]);
+ }
+
+
+ } catch (\Exception $e) {
+ return $this->response->setJSON([
+ 'code' => '9',
+ 'msg' => $e->getMessage(),
+ ]);
+ }
+ }
+}
\ No newline at end of file
diff --git a/app/Models/v2/M703Model.php b/app/Models/v2/M703Model.php
index 8c93edd..29b3893 100644
--- a/app/Models/v2/M703Model.php
+++ b/app/Models/v2/M703Model.php
@@ -877,7 +877,7 @@ class M703Model extends Model
}
// 변경이력 조회
- public function getHistory($rcpt_key, $work_type)
+ public function getHistory($rcpt_key, $work_type = '')
{
if ($work_type == '1') {
diff --git a/app/Models/v2/M704Model.php b/app/Models/v2/M704Model.php
new file mode 100644
index 0000000..63f11a2
--- /dev/null
+++ b/app/Models/v2/M704Model.php
@@ -0,0 +1,1006 @@
+db->query($sql, [$gugun]);
+
+ } else if (!empty($sido)) {
+ $chk_sido = substr($sido, '0', '2');
+
+ if ($chk_sido === '36') {
+ $sido = substr($sido, '0', '4');
+ $sql = "SELECT a.region_cd, TRIM(REPLACE(a.region_nm, b.region_nm, '')) region_nm " .
+ "FROM region_codes a " .
+ "LEFT JOIN region_codes b ON b.region_cd = CONCAT(SUBSTR(a.region_cd,1,4),'000000') " .
+ "WHERE a.region_cd LIKE concat(?, '%') " .
+ "AND a.region_cd NOT LIKE '%000000' " .
+ "AND a.region_cd LIKE '%00' " .
+ "AND a.use_yn = 'Y' " .
+ "AND EXISTS (SELECT 'x' FROM region_codes c WHERE c.region_cd LIKE CONCAT(SUBSTR(a.region_cd,1,5),'%') AND c.region_cd > CONCAT(SUBSTR(a.region_cd,1,5),'00000')) " .
+ "ORDER BY a.region_nm ASC";
+ } else {
+ $sido = substr($sido, '0', '2');
+ $sql = "SELECT a.region_cd, TRIM(REPLACE(a.region_nm, b.region_nm, '')) region_nm" .
+ " FROM region_codes a" .
+ " LEFT JOIN region_codes b ON b.region_cd = CONCAT(SUBSTR(a.region_cd,1,2),'00000000')" .
+ " WHERE a.region_cd LIKE concat(?, '%')" .
+ " AND a.region_cd NOT LIKE '%00000000'" .
+ " AND a.region_cd LIKE '%00000'" .
+ " AND a.use_yn = 'Y'" .
+ " AND EXISTS (SELECT 'x' FROM region_codes c WHERE c.region_cd LIKE CONCAT(SUBSTR(a.region_cd,1,5),'%') AND c.region_cd > CONCAT(SUBSTR(a.region_cd,1,5),'00000'))" .
+ " ORDER BY a.region_nm ASC";
+ }
+
+ $query = $this->db->query($sql, [$sido]);
+ } else {
+ $sql = "SELECT a.region_cd, a.region_nm " .
+ "FROM region_codes a " .
+ "WHERE (a.region_cd LIKE '%00000000' " .
+ "AND a.use_yn = 'Y') " .
+ "OR region_cd = 3611000000;";
+
+ $query = $this->db->query($sql);
+ }
+
+
+ return $query->getResultArray();
+ }
+
+ // 소속본부조회
+ public function getBonbuList()
+ {
+ $sql = "SELECT dept_sq, pdept_sq, dept_nm, dept_desc, dept_head, use_yn, depth, insert_tm, insert_usr, update_tm, update_usr, lft, rgt" .
+ " FROM departments" .
+ " WHERE depth = 1" .
+ " AND use_yn = 'Y'" .
+ " ORDER BY lft";
+
+ $query = $this->db->query($sql);
+
+
+ return $query->getResultArray();
+ }
+
+ // 소속팀 조회
+ public function getTeamList()
+ {
+ $sql = "SELECT dept_sq, pdept_sq, dept_nm" .
+ " FROM departments" .
+ " WHERE depth = 2" .
+ " AND use_yn = 'Y'" .
+ " ORDER BY dept_nm";
+
+ $query = $this->db->query($sql);
+
+
+ return $query->getResultArray();
+ }
+
+ // 유저 조회
+ public function getUserList()
+ {
+ $sql = "SELECT
+ a.usr_sq, a.usr_id, a.usr_nm, a.dept_sq
+ FROM users a
+ WHERE
+ a.usr_level IN ('3','4','40','5','50','6','60','61','62','7','8','70')
+ AND a.use_yn = 'Y'
+ AND EXISTS (
+ SELECT 'x' FROM departments a1 INNER JOIN departments a2 ON a2.lft BETWEEN a1.lft AND a1.rgt AND a2.use_yn = 'Y'
+ WHERE 1=1 AND a2.dept_sq = a.dept_sq AND a1.use_yn = 'Y'
+ )
+ ORDER BY a.usr_level DESC, a.usr_nm ASC ";
+
+ $query = $this->db->query($sql);
+
+ return $query->getResultArray();
+ }
+
+ public function getTotalCount($data)
+ {
+ $sql = "SELECT
+ COUNT(*) AS cnt
+ FROM
+ v2_article_info a
+ JOIN v2_vrfc_req b FORCE INDEX (insert_tm) ON a.vr_sq = b.vr_sq
+ JOIN v2_modify_info c ON a.vr_sq = c.vr_sq
+ JOIN v2_article_info_etc c1 ON c1.vr_sq = a.vr_sq
+ LEFT JOIN region_codes f ON a.address_code = f.region_cd
+ LEFT JOIN v2_chg_stat d ON a.vr_sq = d.vr_sq AND d.stat_cd = 35
+ LEFT JOIN v2_chg_stat e ON a.vr_sq = e.vr_sq AND e.stat_cd = 60
+ LEFT JOIN codes g ON b.stat_cd = g.cd AND g.category = 'STEP_VERIFICATION'
+ LEFT JOIN codes h ON b.vrfc_type = h.cd AND h.category = 'VRFCREQ_WAY'
+ LEFT JOIN users i ON a.charger = i.usr_id
+ LEFT JOIN users j ON a.reg_charger = j.usr_id
+ LEFT JOIN v2_chg_stat d2 ON d2.vr_sq = a.vr_sq AND d2.stat_cd = 39 ";
+
+ if (!empty($data['stat_complete_date'])) {
+ $sql .= "LEFT JOIN v2_chg_stat z1 ON z1.vr_sq = a.vr_sq AND z1.stat_cd = '{$data['stat_complete_date']}' ";
+ }
+
+ $sql .= "WHERE
+ 1=1
+ AND b.insert_tm >= DATE_ADD(CURDATE(), INTERVAL -2 MONTH) ";
+
+
+ // 매물번호
+ if (!empty($data['atcl_no'])) {
+ $sql .= "AND a.atcl = '{$data['atcl_no']}' ";
+ } else {
+ // 현재상태
+ if (!empty($data['stat_cd'])) {
+ $sql .= "AND b.stat_cd = '{$data['stat_cd']}' ";
+ }
+
+ // 중개소
+ if (!empty($data['realtor_nm'])) {
+ $sql .= "AND a.realtor_nm = '{$data['realtor_nm']}' ";
+ }
+
+ // 매물구분
+ if (!empty($data['rlet_type_cd'])) {
+ $sql .= "AND a.rlet_type_cd = '{$data['rlet_type_cd']}' ";
+ }
+
+
+ // 접수기간
+ if (!empty($data['receipt_sdate'])) {
+ $sql .= "AND b.insert_tm >= '{$data['receipt_sdate']} 00:00:00' ";
+ }
+
+ if (!empty($data['receipt_edate'])) {
+ $sql .= "AND b.insert_tm <= '{$data['receipt_edate']} 23:59:59' ";
+ }
+
+ // 진행상태별시간
+ if (!empty($data['stat_complete_date'])) {
+ if (!empty($data['complete_sdate'])) {
+ $sql .= "AND z1.insert_tm >= '{$data['complete_sdate']} 00:00:00' ";
+ }
+
+ if (!empty($data['complete_edate'])) {
+ $sql .= "AND z1.insert_tm <= '{$data['complete_edate']} 23:59:59' ";
+ }
+ }
+
+ // 검증방식
+ if (!empty($data['vrfcreq_way'])) {
+ $sql .= "AND b.vrfc_type = '{$data['vrfcreq_way']}' ";
+ }
+
+ // 매체사
+ if (!empty($data['rcpt_cpid'])) {
+ $sql .= "AND a.cpid = '{$data['rcpt_cpid']}' ";
+ }
+
+ // 지역구분
+ if (!empty($data['srcDong'])) {
+ $sql .= "AND a.address_code = '{$data['srcDong']}' ";
+ } else {
+ if (!empty($data['srcGugun'])) {
+ $str_gugun = substr($data['srcGugun'], '0', '2');
+ if ($str_gugun == '36') { //세종시는 군구가 없고 바로 동이라서 예외
+ $sql .= "AND a.address_code = '{$data['srcGugun']}' ";
+ } else {
+ $gugunPrefix = substr($data['srcGugun'], '0', '5');
+ $sql .= "AND a.address_code LIKE '{$gugunPrefix}%' ";
+ }
+ } else {
+ if (!empty($data['srcSido'])) {
+ $sidoPrefix = substr($data['srcSido'], '0', '2');
+ $sql .= "AND a.address_code LIKE '{$sidoPrefix}%' ";
+ }
+ }
+ }
+
+ // 담당자
+ if (!empty($data['damdang'])) {
+
+ switch ($data['charger_gbn']) {
+ case "1":
+ $sql .= "a.charger = '{$data['damdang']}' ";
+ break;
+ case "2":
+ $sql .= "a.reg_charger = '{$data['damdang']}' ";
+ break;
+ }
+
+ } else {
+ // 배정여부
+ if ($data['assign_yn'] !== "A") {
+ switch ($data['charger_gbn'] . $data['assign_yn']) {
+ case "1Y": // 전화/서류 담당자
+ $sql .= "a.charger != '' ";
+ break;
+ case "1N": // 전화/서류 담당자
+ $sql .= "a.charger = '' ";
+ break;
+ case "2Y": // 등기부등본 담당자
+ $sql .= "a.reg_charger != '' ";
+ break;
+ case "2N": // 등기부등본 담당자
+ $sql .= "a.reg_charger IS NULL ";
+ break;
+ }
+ }
+ }
+
+ // 본부
+ if (!empty($data['bonbu'])) {
+ if ($data['charger_gbn'] === "1") {
+ $sql .= "AND a.dept1_sq = '{$data['bonbu']}' ";
+ } else {
+ $sql .= "AND a.reg_dept1_sq = '{$data['bonbu']}' ";
+ }
+ }
+
+ // 팀
+ if (!empty($data['team'])) {
+ if ($data['charger_gbn'] === "1") {
+ $sql .= "AND a.dept2_sq = '{$data['team']}' ";
+ } else {
+ $sql .= "AND a.reg_dept2_sq = '{$data['team']}' ";
+ }
+ }
+
+ }
+
+ $query = $this->db->query($sql);
+
+
+ return $query->getRow()->cnt;
+ }
+
+ public function getResultList($start, $end, $data)
+ {
+ $sql = "SELECT
+ a.vr_sq,
+ a.atcl_no,
+ a.cpid,
+ a.cp_atcl_id,
+ a.rlet_type_cd,
+ a.address1,
+ a.sise,
+ a.rdate,
+ a.seller_tel_no,
+ a.seller_nm,
+ a.realtor_nm,
+ a.realtor_tel_no,
+ a.rlet_type_cd,
+ a.charger,
+ b.insert_tm,
+ b.tel_fail_cause,
+ b.stat_cd,
+ c.bild_nm,
+ b.contact_fail_cnt,
+ b.vrfc_type,
+ b.memo,
+ c.rm_no,
+ c.floor,
+ c.address_code,
+ c.address2,
+ c1.address2a,
+ c1.address2b,
+ c.address3,
+ c.trade_type,
+ c.deal_amt,
+ c.wrrnt_amt,
+ c.lease_amt,
+ c.isale_amt,
+ c.prem_amt,
+ c.sply_spc,
+ c.excls_spc,
+ c.tot_spc,
+ c.grnd_spc,
+ c.bldg_spc,
+ c.hscp_no,
+ c.ptp_no,
+ d.insert_tm as update_res_tm,
+ e.insert_tm as result_tm,
+ f.region_nm,
+ g.cd_nm as pre_stat,
+ h.cd_nm as vrfc_type,
+ i.usr_nm,
+ j.usr_nm as reg_charger,
+ d2.insert_tm as stat_39_tm
+ FROM
+ v2_article_info a
+ JOIN v2_vrfc_req b FORCE INDEX (insert_tm) ON a.vr_sq = b.vr_sq
+ JOIN v2_modify_info c ON a.vr_sq = c.vr_sq
+ JOIN v2_article_info_etc c1 ON c1.vr_sq = a.vr_sq
+ LEFT JOIN region_codes f ON a.address_code = f.region_cd
+ LEFT JOIN v2_chg_stat d ON a.vr_sq = d.vr_sq AND d.stat_cd = 35
+ LEFT JOIN v2_chg_stat e ON a.vr_sq = e.vr_sq AND e.stat_cd = 60
+ LEFT JOIN codes g ON b.stat_cd = g.cd AND g.category = 'STEP_VERIFICATION'
+ LEFT JOIN codes h ON b.vrfc_type = h.cd AND h.category = 'VRFCREQ_WAY'
+ LEFT JOIN users i ON a.charger = i.usr_id
+ LEFT JOIN users j ON a.reg_charger = j.usr_id
+ LEFT JOIN v2_chg_stat d2 ON d2.vr_sq = a.vr_sq AND d2.stat_cd = 39 ";
+
+ if (!empty($data['stat_complete_date'])) {
+ $sql .= "LEFT JOIN v2_chg_stat z1 ON z1.vr_sq = a.vr_sq AND z1.stat_cd = '{$data['stat_complete_date']}' ";
+ }
+
+
+ $sql .= "WHERE
+ 1=1
+ AND b.insert_tm >= DATE_ADD(CURDATE(), INTERVAL -2 MONTH) ";
+
+
+ // 매물번호
+ if (!empty($data['atcl_no'])) {
+ $sql .= "AND a.atcl = '{$data['atcl_no']}' ";
+ } else {
+ // 현재상태
+ if (!empty($data['stat_cd'])) {
+ $sql .= "AND b.stat_cd = '{$data['stat_cd']}' ";
+ }
+
+ // 중개소
+ if (!empty($data['realtor_nm'])) {
+ $sql .= "AND a.realtor_nm = '{$data['realtor_nm']}' ";
+ }
+
+ // 매물구분
+ if (!empty($data['rlet_type_cd'])) {
+ $sql .= "AND a.rlet_type_cd = '{$data['rlet_type_cd']}' ";
+ }
+
+
+ // 접수기간
+ if (!empty($data['receipt_sdate'])) {
+ $sql .= "AND b.insert_tm >= '{$data['receipt_sdate']} 00:00:00' ";
+ }
+
+ if (!empty($data['receipt_edate'])) {
+ $sql .= "AND b.insert_tm <= '{$data['receipt_edate']} 23:59:59' ";
+ }
+
+ // 진행상태별시간
+ if (!empty($data['stat_complete_date'])) {
+ if (!empty($data['complete_sdate'])) {
+ $sql .= "AND z1.insert_tm >= '{$data['complete_sdate']} 00:00:00' ";
+ }
+
+ if (!empty($data['complete_edate'])) {
+ $sql .= "AND z1.insert_tm <= '{$data['complete_edate']} 23:59:59' ";
+ }
+ }
+
+
+ // 검증방식
+ if (!empty($data['vrfcreq_way'])) {
+ $sql .= "AND b.vrfc_type = '{$data['vrfcreq_way']}' ";
+ }
+
+ // 매체사
+ if (!empty($data['rcpt_cpid'])) {
+ $sql .= "AND a.cpid = '{$data['rcpt_cpid']}' ";
+ }
+
+ // 지역구분
+ if (!empty($data['srcDong'])) {
+ $sql .= "AND a.address_code = '{$data['srcDong']}' ";
+ } else {
+ if (!empty($data['srcGugun'])) {
+ $str_gugun = substr($data['srcGugun'], '0', '2');
+ if ($str_gugun == '36') { //세종시는 군구가 없고 바로 동이라서 예외
+ $sql .= "AND a.address_code = '{$data['srcGugun']}' ";
+ } else {
+ $gugunPrefix = substr($data['srcGugun'], '0', '5');
+ $sql .= "AND a.address_code LIKE '{$gugunPrefix}%' ";
+ }
+ } else {
+ if (!empty($data['srcSido'])) {
+ $sidoPrefix = substr($data['srcSido'], '0', '2');
+ $sql .= "AND a.address_code LIKE '{$sidoPrefix}%' ";
+ }
+ }
+ }
+
+ // 담당자
+ if (!empty($data['damdang'])) {
+
+ switch ($data['charger_gbn']) {
+ case "1":
+ $sql .= "a.charger = '{$data['damdang']}' ";
+ break;
+ case "2":
+ $sql .= "a.reg_charger = '{$data['damdang']}' ";
+ break;
+ }
+
+ } else {
+ // 배정여부
+ if ($data['assign_yn'] !== "A") {
+ switch ($data['charger_gbn'] . $data['assign_yn']) {
+ case "1Y": // 전화/서류 담당자
+ $sql .= "a.charger != '' ";
+ break;
+ case "1N": // 전화/서류 담당자
+ $sql .= "a.charger = '' ";
+ break;
+ case "2Y": // 등기부등본 담당자
+ $sql .= "a.reg_charger != '' ";
+ break;
+ case "2N": // 등기부등본 담당자
+ $sql .= "a.reg_charger IS NULL ";
+ break;
+ }
+ }
+ }
+
+ // 본부
+ if (!empty($data['bonbu'])) {
+ if ($data['charger_gbn'] === "1") {
+ $sql .= "AND a.dept1_sq = '{$data['bonbu']}' ";
+ } else {
+ $sql .= "AND a.reg_dept1_sq = '{$data['bonbu']}' ";
+ }
+ }
+
+ // 팀
+ if (!empty($data['team'])) {
+ if ($data['charger_gbn'] === "1") {
+ $sql .= "AND a.dept2_sq = '{$data['team']}' ";
+ } else {
+ $sql .= "AND a.reg_dept2_sq = '{$data['team']}' ";
+ }
+ }
+
+ }
+
+ $sql .= "ORDER BY b.vr_sq DESC, b.insert_tm DESC ";
+
+ $sql .= "LIMIT {$start}, {$end} ";
+
+ // print ($sql);
+
+ $query = $this->db->query($sql);
+
+ return $query->getResultArray();
+ }
+
+
+ // 엑셀다운로드
+ public function getExcelList($data)
+ {
+ $sql = "SELECT
+ a.atcl_no AS '매물번호'
+ , g.cd_nm AS '진행상태'
+ , CASE WHEN b.tel_fail_cause IS NULL THEN '관련없음' ELSE
+ (SELECT cd_nm FROM codes WHERE category = 'TEL_FAIL_CAUSE' AND cd = b.tel_fail_cause) END AS '중개업소 어뷰징 의심'
+ , b.contact_fail_cnt AS '통화실패횟수'
+ , a.seller_tel_no AS '의뢰인(매도자) 전화번호'
+ , b.insert_tm AS '접수시간'
+ , h.cd_nm AS '검증방식'
+ , CONCAT(f.region_nm, ' ', c.rm_no) AS '주소'
+ , CONCAT(c.address2, ' ', c.address3) AS '상세주소'
+ , a.cpid AS '매체사'
+ , a.realtor_nm AS '중개소'
+ , IFNULL(d.insert_tm, d2.insert_tm) AS '서류/전화 확인시간'
+ , i.usr_nm AS '담당자'
+ , e.insert_tm AS '검증완료일시'
+ , b.memo AS '메모'
+ FROM
+ v2_article_info a
+ JOIN v2_vrfc_req b FORCE INDEX (insert_tm) ON a.vr_sq = b.vr_sq
+ JOIN v2_modify_info c ON a.vr_sq = c.vr_sq
+ JOIN v2_article_info_etc c1 ON c1.vr_sq = a.vr_sq
+ LEFT JOIN region_codes f ON a.address_code = f.region_cd
+ LEFT JOIN v2_chg_stat d ON a.vr_sq = d.vr_sq AND d.stat_cd = 35
+ LEFT JOIN v2_chg_stat e ON a.vr_sq = e.vr_sq AND e.stat_cd = 60
+ LEFT JOIN codes g ON b.stat_cd = g.cd AND g.category = 'STEP_VERIFICATION'
+ LEFT JOIN codes h ON b.vrfc_type = h.cd AND h.category = 'VRFCREQ_WAY'
+ LEFT JOIN users i ON a.charger = i.usr_id
+ LEFT JOIN users j ON a.reg_charger = j.usr_id
+ LEFT JOIN v2_chg_stat d2 ON d2.vr_sq = a.vr_sq AND d2.stat_cd = 39 ";
+
+ if (!empty($data['stat_complete_date'])) {
+ $sql .= "LEFT JOIN v2_chg_stat z1 ON z1.vr_sq = a.vr_sq AND z1.stat_cd = '{$data['stat_complete_date']}' ";
+ }
+
+
+ $sql .= "WHERE
+ 1=1
+ AND b.insert_tm >= DATE_ADD(CURDATE(), INTERVAL -2 MONTH) ";
+
+
+ // 매물번호
+ if (!empty($data['atcl_no'])) {
+ $sql .= "AND a.atcl = '{$data['atcl_no']}' ";
+ } else {
+ // 현재상태
+ if (!empty($data['stat_cd'])) {
+ $sql .= "AND b.stat_cd = '{$data['stat_cd']}' ";
+ }
+
+ // 중개소
+ if (!empty($data['realtor_nm'])) {
+ $sql .= "AND a.realtor_nm = '{$data['realtor_nm']}' ";
+ }
+
+ // 매물구분
+ if (!empty($data['rlet_type_cd'])) {
+ $sql .= "AND a.rlet_type_cd = '{$data['rlet_type_cd']}' ";
+ }
+
+
+ // 접수기간
+ if (!empty($data['receipt_sdate'])) {
+ $sql .= "AND b.insert_tm >= '{$data['receipt_sdate']} 00:00:00' ";
+ }
+
+ if (!empty($data['receipt_edate'])) {
+ $sql .= "AND b.insert_tm <= '{$data['receipt_edate']} 23:59:59' ";
+ }
+
+ // 진행상태별시간
+ if (!empty($data['stat_complete_date'])) {
+ if (!empty($data['complete_sdate'])) {
+ $sql .= "AND z1.insert_tm >= '{$data['complete_sdate']} 00:00:00' ";
+ }
+
+ if (!empty($data['complete_edate'])) {
+ $sql .= "AND z1.insert_tm <= '{$data['complete_edate']} 23:59:59' ";
+ }
+ }
+
+
+ // 검증방식
+ if (!empty($data['vrfcreq_way'])) {
+ $sql .= "AND b.vrfc_type = '{$data['vrfcreq_way']}' ";
+ }
+
+ // 매체사
+ if (!empty($data['rcpt_cpid'])) {
+ $sql .= "AND a.cpid = '{$data['rcpt_cpid']}' ";
+ }
+
+ // 지역구분
+ if (!empty($data['srcDong'])) {
+ $sql .= "AND a.address_code = '{$data['srcDong']}' ";
+ } else {
+ if (!empty($data['srcGugun'])) {
+ $str_gugun = substr($data['srcGugun'], '0', '2');
+ if ($str_gugun == '36') { //세종시는 군구가 없고 바로 동이라서 예외
+ $sql .= "AND a.address_code = '{$data['srcGugun']}' ";
+ } else {
+ $gugunPrefix = substr($data['srcGugun'], '0', '5');
+ $sql .= "AND a.address_code LIKE '{$gugunPrefix}%' ";
+ }
+ } else {
+ if (!empty($data['srcSido'])) {
+ $sidoPrefix = substr($data['srcSido'], '0', '2');
+ $sql .= "AND a.address_code LIKE '{$sidoPrefix}%' ";
+ }
+ }
+ }
+
+ // 담당자
+ if (!empty($data['damdang'])) {
+
+ switch ($data['charger_gbn']) {
+ case "1":
+ $sql .= "a.charger = '{$data['damdang']}' ";
+ break;
+ case "2":
+ $sql .= "a.reg_charger = '{$data['damdang']}' ";
+ break;
+ }
+
+ } else {
+ // 배정여부
+ if ($data['assign_yn'] !== "A") {
+ switch ($data['charger_gbn'] . $data['assign_yn']) {
+ case "1Y": // 전화/서류 담당자
+ $sql .= "a.charger != '' ";
+ break;
+ case "1N": // 전화/서류 담당자
+ $sql .= "a.charger = '' ";
+ break;
+ case "2Y": // 등기부등본 담당자
+ $sql .= "a.reg_charger != '' ";
+ break;
+ case "2N": // 등기부등본 담당자
+ $sql .= "a.reg_charger IS NULL ";
+ break;
+ }
+ }
+ }
+
+ // 본부
+ if (!empty($data['bonbu'])) {
+ if ($data['charger_gbn'] === "1") {
+ $sql .= "AND a.dept1_sq = '{$data['bonbu']}' ";
+ } else {
+ $sql .= "AND a.reg_dept1_sq = '{$data['bonbu']}' ";
+ }
+ }
+
+ // 팀
+ if (!empty($data['team'])) {
+ if ($data['charger_gbn'] === "1") {
+ $sql .= "AND a.dept2_sq = '{$data['team']}' ";
+ } else {
+ $sql .= "AND a.reg_dept2_sq = '{$data['team']}' ";
+ }
+ }
+
+ }
+
+ $sql .= "ORDER BY b.vr_sq DESC, b.insert_tm DESC ";
+
+ // print ($sql);
+
+ $query = $this->db->query($sql);
+
+ return $query->getResultArray();
+ }
+
+
+ // 상세내용 조회
+ public function getDetail($vr_sq)
+ {
+ $sql = "SELECT
+ a.vr_sq,
+ b.tel_fail_cause,
+ a.atcl_no,
+ a.cpid,
+ a.cp_atcl_id,
+ a.rlet_type_cd,
+ a.address1,
+ b.try_cnt,
+ b.reg_try_cnt,
+ a.sise,
+ a.rdate,
+ a.seller_tel_no,
+ a.seller_nm,
+ a.realtor_nm,
+ a.realtor_tel_no,
+ a.charger,
+ a.chg_trade_type,
+ a.chg_address2,
+ a.chg_address3,
+ a.chg_seller_tel,
+ a.chg_amt,
+ b.stat_cd,
+ b.insert_tm,
+ b.contact_fail_cnt,
+ a.reg_charger,
+ i2.usr_nm as reg_charger_nm,
+ c.bild_nm,
+ b.vrfc_type as vrfc_type_cd,
+ b.memo,
+ b.req_type,
+ c.rm_no,
+ c.floor,
+ c.floor2,
+ c.address_code,
+ c.address2,
+ c1.address2a,
+ c1.address2b,
+ c.address3,
+ c.address4,
+ c.trade_type as trade_type_cd,
+ c.deal_amt,
+ c.wrrnt_amt,
+ c.lease_amt,
+ c.isale_amt,
+ c.prem_amt,
+ c.sply_spc,
+ c.excls_spc,
+ c.tot_spc,
+ c.grnd_spc,
+ c.bldg_spc,
+ c.hscp_no,
+ c.ptp_no,
+ d.insert_tm as update_res_tm,
+ e.insert_tm as result_tm,
+ f.region_nm,
+ g.cd_nm as pre_stat,
+ g.cd as pre_stat_cd,
+ h.cd_nm as vrfc_type,
+ i.usr_nm,
+ j.cd_nm as trade_type,
+ c.hscp_nm,
+ c.ptp_nm,
+ l.success,
+ k.cd_nm as atcl_nm,
+ m.code as result_d11,
+ m.comment,
+ n.code as fax_conf_yn_2,
+ o.code as fax_conf_yn_3,
+ p.code as fax_conf_yn_4,
+ n.comment as fax_conf_yn_info_2,
+ o.comment as fax_conf_yn_info_3,
+ p.comment as fax_conf_yn_info_4,
+ v.success AS tel_suc,
+ r.code AS tel_agree,
+ s.code AS tel_conf_yn_2,
+ t.code AS tel_conf_yn_3,
+ u.code AS tel_conf_yn_4,
+ z.code AS tel_conf_yn_5,
+ s.comment AS tel_conf_yn_info_2,
+ t.comment AS tel_conf_yn_info_3,
+ u.comment AS tel_conf_yn_info_4,
+ w.success AS reg_conf_yn_1,
+ x.code AS reg_conf_yn_2,
+ y.code AS reg_conf_yn_3,
+ x.comment AS reg_conf_yn_info_2,
+ y.comment AS reg_conf_yn_info_3,
+ b.rgbk_confirm,
+ c1.vir_addr_yn,
+ a.ownerNm
+ FROM v2_article_info a
+ JOIN v2_vrfc_req b ON a.vr_sq = b.vr_sq
+ JOIN v2_modify_info c ON a.vr_sq = c.vr_sq
+ JOIN v2_article_info_etc c1 ON c1.vr_sq = a.vr_sq
+ LEFT JOIN region_codes f ON a.address_code = f.region_cd
+ LEFT JOIN v2_chg_stat d ON a.vr_sq = d.vr_sq AND d.stat_cd = 35
+ LEFT JOIN v2_chg_stat e ON a.vr_sq = e.vr_sq AND e.stat_cd = 60
+ LEFT JOIN codes g ON b.stat_cd = g.cd AND g.category = 'STEP_VERIFICATION'
+ LEFT JOIN codes h ON b.vrfc_type = h.cd AND h.category = 'VRFCREQ_WAY'
+ LEFT JOIN codes j ON c.trade_type = j.cd AND j.category = 'TRADE_TYPE'
+ LEFT JOIN codes k ON a.rlet_type_cd = k.cd AND k.category = 'ARTICLE_TYPE'
+ LEFT JOIN v2_confirm l ON a.vr_sq = l.vr_sq AND l.vrfc_type = 'D'
+ LEFT JOIN v2_check_list m ON a.vr_sq = m.vr_sq AND m.type = 'D11'
+ LEFT JOIN v2_check_list n ON a.vr_sq = n.vr_sq AND n.type = 'D12'
+ LEFT JOIN v2_check_list o ON a.vr_sq = o.vr_sq AND o.type = 'D13'
+ LEFT JOIN v2_check_list p ON a.vr_sq = p.vr_sq AND p.type = 'D14'
+ LEFT JOIN v2_confirm v ON a.vr_sq = v.vr_sq AND v.vrfc_type = 'T'
+ LEFT JOIN v2_check_list r ON a.vr_sq = r.vr_sq AND r.type = 'T11'
+ LEFT JOIN v2_check_list s ON a.vr_sq = s.vr_sq AND s.type = 'T12'
+ LEFT JOIN v2_check_list t ON a.vr_sq = t.vr_sq AND t.type = 'T13'
+ LEFT JOIN v2_check_list u ON a.vr_sq = u.vr_sq AND u.type = 'T14'
+ LEFT JOIN v2_check_list z ON a.vr_sq = z.vr_sq AND z.type = 'T15'
+ LEFT JOIN v2_confirm w ON a.vr_sq = w.vr_sq AND w.vrfc_type = 'R'
+ LEFT JOIN v2_check_list x ON a.vr_sq = x.vr_sq AND x.type = '21'
+ LEFT JOIN v2_check_list y ON a.vr_sq = y.vr_sq AND y.type = '22'
+ LEFT JOIN users i ON a.charger = i.usr_id
+ LEFT JOIN users i2 ON a.reg_charger = i2.usr_id
+
+ WHERE a.vr_sq = " . $vr_sq;
+
+
+ $query = $this->db->query($sql);
+
+ return $query->getRowArray();
+ }
+
+ // 메모조회
+ public function getMemo($vr_sq)
+ {
+ $sql = "SELECT memo FROM v2_vrfc_req where vr_sq = ?";
+
+ $query = $this->db->query($sql, [$vr_sq]);
+
+ return $query->getRowArray();
+ }
+
+ // 변경이력 조회
+ public function getHistory($rcpt_key, $work_type = '')
+ {
+ if ($work_type == '1') {
+
+ $sql = "SELECT
+ a.seq,
+ a.rcpt_sq vr_sq,
+ a.rcpt_stat stat_cd,
+ a.changed_type chg_type,
+ a.changed_id insert_id,
+ a.changed_tm insert_tm,
+ a.remark memo,
+ b.cd_nm as stat_cd_nm,
+ c.cd_nm as chg_type
+ FROM changed_history a
+ LEFT JOIN codes b ON a.rcpt_stat = b.cd AND b.category = 'RECEIPT_STATUS3'
+ LEFT JOIN codes c ON a.changed_type = c.cd AND c.category = 'CHANGED_TYPE'
+ WHERE a.rcpt_sq = ?
+ ORDER BY a.seq DESC
+ ";
+
+ $query = $this->db->query($sql, [$rcpt_key]);
+
+ $history = $query->getResultArray();
+
+ return $history;
+ } else {
+
+ $sql = "SELECT
+ a.seq,
+ a.vr_sq,
+ a.stat_cd,
+ a.chg_type,
+ a.insert_id,
+ a.insert_tm,
+ a.memo,
+ b.cd_nm as stat_cd_nm,
+ c.cd_nm as chg_type
+ FROM v2_chg_history a
+ LEFT JOIN codes b ON a.stat_cd = b.cd AND b.category = 'STEP_VERIFICATION'
+ LEFT JOIN codes c ON a.chg_type = c.cd AND c.category = 'CHANGED_TYPE'
+ WHERE a.vr_sq = ?
+ ORDER BY a.seq DESC
+ ";
+
+
+ $query = $this->db->query($sql, [$rcpt_key]);
+ $history = $query->getResultArray();
+
+ return $history;
+ }
+ }
+
+ // 등기부등본
+ public function oneGetRecordInfo($vr_sq, $file_type)
+ {
+ $sql = "SELECT seq, vr_sq, use_yn, file_type, view_odr, file_path, file_name, file_ext, file_size, img_width, img_height, meta_data, insert_user, insert_tm " .
+ " FROM v2_files" .
+ " WHERE vr_sq = ?" .
+ " AND use_yn = 'Y'" .
+ " AND file_type = ?";
+
+ $query = $this->db->query($sql, [$vr_sq, $file_type]);
+
+ return $query->getRowArray();
+ }
+
+ // 주택임대사업자번호 리스트
+ public function getPhoneNumber()
+ {
+ $sql = " select phone_number
+ from dupl_phone_list
+ where use_yn = 'Y'";
+
+ $query = $this->db->query($sql);
+
+ return $query->getResultArray();
+ }
+
+ // 녹취파일
+ public function getRecordInfo($vr_sq, $file_type)
+ {
+ $sql = "SELECT seq, vr_sq, use_yn, file_type, view_odr, file_path, file_name, file_ext, file_size, img_width, img_height, meta_data, insert_user, insert_tm " .
+ " FROM v2_files" .
+ " WHERE vr_sq = ?" .
+ " AND use_yn = 'Y'" .
+ " AND file_type = ?";
+ $data = [
+ $vr_sq,
+ $file_type
+ ];
+
+ $query = $this->db->query($sql, [$vr_sq, $file_type]);
+
+ return $query->getRowArray();
+ }
+
+ // 파일정보 저장
+ public function saveFileInfo($data)
+ {
+ $sql = "INSERT INTO v2_files
+ (vr_sq, file_type, view_odr, file_path, file_name, file_ext, file_size, insert_user, insert_tm, cloud_upload_yn)
+ VALUES
+ (?, '3', 0, ?, ?, ?, ?, ?, NOW(), 'Y')
+ ";
+
+ $param = [
+ $data['vr_sq'],
+ $data['file_path'],
+ $data['new_name'],
+ $data['ext'],
+ $data['size'],
+ $data['usr_id'],
+ ];
+
+
+ if ($this->db->query($sql, $param)) {
+ return [
+ 'success' => false,
+ 'msg' => '파일정보 저장 실패',
+ ];
+ }
+
+ return [
+ 'success' => true
+ ];
+ }
+
+ // 정보변경 이력 저장
+ public function saveChangedHistory($vr_sq, $stat_cd, $chg_type, $usr_id, $memo)
+ {
+ $sql = "INSERT INTO v2_chg_history" .
+ " (vr_sq, stat_cd, chg_type, insert_id, insert_tm, memo)" .
+ " VALUES" .
+ " (?, ?, ?, ?, now(), ?)";
+
+ $data = [
+ $vr_sq,
+ $stat_cd,
+ $chg_type,
+ $usr_id,
+ $memo
+ ];
+
+ $res = $this->db->query($sql, $data);
+ }
+
+ // 메모저장
+ public function saveMemo($data)
+ {
+ $usr_id = session('usr_id');
+
+ $sql = "UPDATE v2_vrfc_req SET
+ memo = ?
+ WHERE vr_sq = ?";
+
+ if ($this->db->query($sql, $data) === false) {
+ return [
+ 'success' => false,
+ 'msg' => '파일정보 저장 실패',
+ ];
+ }
+
+ $row = $this->getDetail($data[1]);
+
+ $memo = "메모변경 : " . $row['memo'] . " => " . $data[0];
+ $this->saveChangedHistory($data[1], $row['pre_stat_cd'], 'C19', $usr_id, $memo);
+
+ return [
+ 'success' => true
+ ];
+ }
+
+ // 다음 전화매물 가져오기
+ public function getNextTelInfo($vr_sq)
+ {
+ $this->db->transStart();
+ $usr_id = session('usr_id');
+
+ $sql = "SELECT a.vr_sq FROM v2_article_info a " .
+ "JOIN v2_vrfc_req b ON a.vr_sq = b.vr_sq " .
+ "WHERE b.stat_cd = '30' and b.insert_tm > DATE_ADD(NOW(), INTERVAL -7 day) " .
+ "AND a.rdate < date_format(curdate(), '%Y-%m-%d 17:29:00') " .
+ "AND b.vrfc_type ='T' " .
+ "AND a.vr_sq > ? " .
+ "AND a.charger='admin' " .
+ "ORDER BY a.vr_sq asc " .
+ "LIMIT 1 " .
+ "FOR UPDATE SKIP LOCKED";
+
+ $data = [$vr_sq];
+
+
+ $query = $this->db->query($sql, $data);
+ $row = $query->getRowArray();
+
+ $sql = "UPDATE v2_article_info " .
+ "SET charger = '" . $usr_id . "' " .
+ "WHERE vr_sq ='" . $row['vr_sq'] . "'";
+ $this->db->query($sql);
+
+ $this->db->transComplete();
+
+ return $row;
+ }
+}
\ No newline at end of file
diff --git a/app/Views/layouts/main.php b/app/Views/layouts/main.php
index 89a2360..49437d9 100644
--- a/app/Views/layouts/main.php
+++ b/app/Views/layouts/main.php
@@ -1,5 +1,5 @@
-
+
= $this->include('layouts/header') ?>
diff --git a/app/Views/pages/v2/m701/detail.php b/app/Views/pages/v2/m701/detail.php
index 7b8e46a..5fff127 100644
--- a/app/Views/pages/v2/m701/detail.php
+++ b/app/Views/pages/v2/m701/detail.php
@@ -144,7 +144,7 @@ if (!empty($data['cert_register']) && $data['cert_register_save_yn'] != 'Y') { /
-
단지 정보
+
매물 정보
@@ -237,14 +237,14 @@ if (!empty($data['cert_register']) && $data['cert_register_save_yn'] != 'Y') { /
| 상세주소 |
-
+ |
-
-
diff --git a/app/Views/pages/v2/m704/detail.php b/app/Views/pages/v2/m704/detail.php
new file mode 100644
index 0000000..3e6f024
--- /dev/null
+++ b/app/Views/pages/v2/m704/detail.php
@@ -0,0 +1,1089 @@
+
+= $this->extend('layouts/main') ?>
+
+= $this->section('content') ?>
+
+
+
+
+
+
+
+
+
+ 공인 중개사 정보
+
+
+
+
+
+
+
+
+ | 중개사명 |
+
+ = $data['realtor_nm'] ?>
+ |
+ 대표전화 |
+
+ = $data['realtor_tel_no'] ?>
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+ 단지 정보
+
+
+
+ | 단지명 |
+ |
+ 단지타입명 |
+ |
+ 사용승인일 |
+ |
+ 단지 총 세수 |
+ |
+ 단지 총 동수 |
+ |
+ 단지 총 평수 |
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+= $this->section('modals') ?>
+
+= $this->endSection() ?>
+
+
+
+
+= $this->endSection() ?>
\ No newline at end of file
diff --git a/app/Views/pages/v2/m704/lists.php b/app/Views/pages/v2/m704/lists.php
new file mode 100644
index 0000000..6e3baa9
--- /dev/null
+++ b/app/Views/pages/v2/m704/lists.php
@@ -0,0 +1,717 @@
+= $this->extend('layouts/main') ?>
+
+= $this->section('content') ?>
+
+
+전화확인매물 현황
+
+
+
+
+
+
+
+
+
+
+
+ | 매물번호 |
+ 진행상태 |
+ 통화실패 횟수 |
+ 접수시간 |
+ 검증방식 |
+ 주소 |
+ 상세주소 |
+ 매체사 |
+ 중개소 |
+ 서류/전화 담당자 |
+ 서류/전화 확인시간 |
+ 등기부등본 담당자 |
+ 검증완료 일시 |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+= $this->endSection() ?>
\ No newline at end of file
|