상세수정
Reviewed-on: http://192.168.10.243:3000/owrainfo/confirms/pulls/46
This commit was merged in pull request #46.
This commit is contained in:
@@ -176,10 +176,19 @@ $routes->group('', ['namespace' => 'App\Controllers\V2'], static function ($rout
|
||||
*/
|
||||
$routes->get('m701a/getResultList', 'M701::getResultList');
|
||||
$routes->get('m701a/excel', 'M701::excel');
|
||||
$routes->post('m701a/chgArticleStatus', 'M701::chgArticleStatus'); // 상태정보변경
|
||||
|
||||
$routes->post('m701a/changePrice', 'M701::changePrice'); // 가격수정
|
||||
$routes->post('m701a/chgArticleStatus', 'M701::chgArticleStatus'); // 상태정보변경
|
||||
$routes->post('m701a/modifyInfo', 'M701::modifyInfo'); // 정보수정
|
||||
$routes->post('m701a/saveMemo', 'M701::saveMemo'); // 메모저장
|
||||
|
||||
$routes->post('m701a/saveDocu', 'M701::saveDocu'); // 서류 저장
|
||||
$routes->post('m701a/saveTel', 'M701::saveTel'); // 전화정보 저장
|
||||
$routes->post('m701a/saveRegi', 'M701::saveRegi'); // 등기부등본 저장
|
||||
$routes->post('m701a/saveFinalRegi', 'M701::saveFinalRegi'); // 검증최종실패 처리
|
||||
|
||||
$routes->post('m701a/uploadFile', 'M701::uploadFile'); // 파일업로드
|
||||
|
||||
});
|
||||
|
||||
/**
|
||||
@@ -220,6 +229,7 @@ $routes->group('', ['namespace' => 'App\Controllers\V2'], static function ($rout
|
||||
$routes->post('m703a/saveRequestMessage', 'M703::saveRequestMessage'); // 중개사요청사항저장
|
||||
$routes->post('m703a/saveResult', 'M703::saveResult'); // 결과저장
|
||||
|
||||
|
||||
/**
|
||||
* 홍보확인서 확인
|
||||
*/
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
73
app/Controllers/V2/V2StDailyModel.php
Normal file
73
app/Controllers/V2/V2StDailyModel.php
Normal file
@@ -0,0 +1,73 @@
|
||||
<?php
|
||||
namespace App\Controllers\V2;
|
||||
|
||||
use CodeIgniter\Model;
|
||||
|
||||
class V2StDailyModel extends Model
|
||||
{
|
||||
/**
|
||||
* 일자별 통계데이터에 값 집어 넣기...
|
||||
* 반환값 없음.
|
||||
* @param date $sd_date 날짜 값이 없을경우 현재날짜로 입력됨.
|
||||
* @param string $cpid CPID
|
||||
* @param string $gbn_cd 코드값 (category='STATISTICS_DAILY3')
|
||||
* @param int $cnt 더할 숫자..
|
||||
* @param string $cnt_type 숫자를 더할것인지.. 아니변 변경할것인지.
|
||||
*/
|
||||
public function set_v2_st_daily($st_date, $cpid, $gbn_cd, $cnt, $cnt_type = 'add')
|
||||
{
|
||||
/**
|
||||
* insert into v2_st_daily (sd_date, cpid, gbn_cd, cnt) values ($sd_date, $cpid, $gbn_cd, $cnt)
|
||||
* on duplicate key update cnt = values(cnt); // $cnt_type='change'
|
||||
* on duplicate key update cnt = cnt + $cnt; // $cnt_type='add'
|
||||
*/
|
||||
if (empty($cnt))
|
||||
$cnt = '0';
|
||||
|
||||
$sql_dup = "";
|
||||
switch (strtolower($cnt_type)) {
|
||||
case 'add':
|
||||
$sql_dup = "on duplicate key update cnt = cnt + " . $cnt;
|
||||
break;
|
||||
|
||||
case 'change':
|
||||
$sql_dup = "on duplicate key update cnt = values(cnt)";
|
||||
break;
|
||||
}
|
||||
if (empty($st_date)) {
|
||||
$sql = "insert into v2_st_daily (st_date, cpid, gbn_cd, cnt) values (now(), ?, ?, ?)" . $sql_dup;
|
||||
$data = array(
|
||||
$cpid,
|
||||
$gbn_cd,
|
||||
$cnt
|
||||
);
|
||||
} else {
|
||||
$sql = "insert into v2_st_daily (st_date, cpid, gbn_cd, cnt) values (?, ?, ?, ?)" . $sql_dup;
|
||||
$data = array(
|
||||
$st_date,
|
||||
$cpid,
|
||||
$gbn_cd,
|
||||
$cnt
|
||||
);
|
||||
}
|
||||
$this->db->query($sql, $data);
|
||||
|
||||
$return['error_number'] = $this->db->_error_number();
|
||||
$return['error_message'] = $this->db->_error_message();
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* 지정한 매물의 요청번호를 이용하여 요청내역을 가져온다.
|
||||
*/
|
||||
public function get_v2_vrfc_req($vr_sq)
|
||||
{
|
||||
$columns = "vr_sq,atcl_no,step,cpid,cp_atcl_id,trade_type,realtor_nm,realtor_tel_no,seller_tel_no,vrfc_type,rgbk_confirm,req_type,rdate,stat_cd,try_cnt,insert_user,insert_tm,memo,contact_fail_cnt,sync_yn,reg_try_cnt";
|
||||
$builder = $this->db->table('v2_vrfc_req');
|
||||
$builder->select($columns, false);
|
||||
$builder->where('vr_sq', $vr_sq);
|
||||
$row = $builder->get()->getRowArray();
|
||||
return $row;
|
||||
}
|
||||
}
|
||||
57
app/Libraries/FormValidation.php
Normal file
57
app/Libraries/FormValidation.php
Normal file
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
namespace App\Libraries;
|
||||
|
||||
class FormValidation
|
||||
{
|
||||
/**
|
||||
* 한글, 영문, 숫자, 대시, 언더바만 가능하게 한다. utf-8 기준.
|
||||
*
|
||||
* @param string $str 검증할 문자열
|
||||
* @param string|null $error 에러 메시지 (참조로 전달)
|
||||
* @return bool
|
||||
*/
|
||||
public function korean_alpha_dash(string $str, ?string &$error = null): bool
|
||||
{
|
||||
if (!preg_match('/^[\x{1100}-\x{11FF}\x{3130}-\x{318F}\x{AC00}-\x{D7AF}0-9a-zA-Z_-]+$/u', $str)) {
|
||||
$error = '한글, 영문, 숫자, 대시, 언더바만 입력 가능합니다.';
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 문자열 형식이 Date가 맞는지 확인한다.
|
||||
*
|
||||
* @param string $str 검증할 날짜 문자열
|
||||
* @param string $format 날짜 형식 (기본값: Y-m-d)
|
||||
* @param string|null $error 에러 메시지 (참조로 전달)
|
||||
* @return bool
|
||||
*/
|
||||
public function is_date(string $str, string $format = 'Y-m-d', ?string &$error = null): bool
|
||||
{
|
||||
try {
|
||||
if (empty($format)) {
|
||||
$format = 'Y-m-d';
|
||||
}
|
||||
|
||||
$date = strtotime($str);
|
||||
|
||||
if ($date === false) {
|
||||
$error = '올바른 날짜 형식이 아닙니다.';
|
||||
return false;
|
||||
}
|
||||
|
||||
$strDate = date($format, $date);
|
||||
|
||||
if (strcmp($str, $strDate) !== 0) {
|
||||
$error = "날짜 형식이 {$format}와 일치하지 않습니다.";
|
||||
return false;
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
$error = '날짜 검증 중 오류가 발생했습니다.';
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -2,11 +2,20 @@
|
||||
|
||||
namespace App\Libraries;
|
||||
|
||||
use App\Models\common\CommonModel;
|
||||
|
||||
class NaverApiClient
|
||||
{
|
||||
protected $baseUrl = 'https://test-b2b.land.naver.com';
|
||||
protected $charger = '';
|
||||
|
||||
private $commonModel;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->commonModel = new CommonModel();
|
||||
}
|
||||
|
||||
/**
|
||||
* [GET] 매물 정보 조회
|
||||
*/
|
||||
@@ -27,7 +36,7 @@ class NaverApiClient
|
||||
{
|
||||
$this->charger = $charger;
|
||||
$url = "{$this->baseUrl}/kiso/center/verification-article/{$articleNumber}?charger={$this->charger}";
|
||||
|
||||
|
||||
return $this->request('PUT', $url, $updateData);
|
||||
}
|
||||
|
||||
@@ -38,6 +47,212 @@ class NaverApiClient
|
||||
return $this->request('GET', $url);
|
||||
}
|
||||
|
||||
/**
|
||||
* 단지상세정보조회
|
||||
* hscpNo : 단지번호(숫자)
|
||||
*/
|
||||
public function aptDetail($hscpNo)
|
||||
{
|
||||
$url = $this->commonModel->getCompanyInfo(2);
|
||||
$url = $url['api_server'] . "/confirms/APTDetail?hscpNo={$hscpNo}";
|
||||
return $this->request('GET', $url);
|
||||
}
|
||||
|
||||
/**
|
||||
* 빌라 단지상세정보 조회
|
||||
* hscpNo : 단지번호(숫자)
|
||||
*/
|
||||
|
||||
public function villaDetail($hscpNo)
|
||||
{
|
||||
$url = $this->commonModel->getCompanyInfo(2);
|
||||
$url = $url['api_server'] . "/confirms/villa/{$hscpNo}";
|
||||
return $this->request('GET', $url);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 단지목록
|
||||
* cortarNo : 법정동코드
|
||||
*/
|
||||
public function complexList($cortarNo)
|
||||
{
|
||||
$url = $this->commonModel->getCompanyInfo(2);
|
||||
$url = $url['api_server'] . "/common/complexList.nhn?cortarNo={$cortarNo}";
|
||||
return $this->request('GET', $url);
|
||||
}
|
||||
|
||||
/**
|
||||
* 평형목록
|
||||
* rletNo : 단지번호
|
||||
*/
|
||||
public function ptpList($rletNo)
|
||||
{
|
||||
$url = $this->commonModel->getCompanyInfo(2);
|
||||
$url = $url['api_server'] . "/common/ptpList.nhn?rletNo={$rletNo}";
|
||||
return $this->request('GET', $url);
|
||||
}
|
||||
|
||||
/**
|
||||
* 가격수정
|
||||
* @param String atclNo 매물번호
|
||||
* @param integer dealAmt 매매가, 전세(보증금) 단위 : 만원
|
||||
* @param integer wrrntAmt 전세가(보증금) 단위 : 만원
|
||||
* @param integer leaseAmt 월세가 단위 : 만원
|
||||
* @param integer isaleAmt 분양가 단위 : 만원
|
||||
* @param integer premAmt 프리미엄 단위 : 만원
|
||||
* @param integer charger 담당자id
|
||||
*/
|
||||
public function priceChange($atclNo, $dealAmt, $wrrntAmt, $leaseAmt, $isaleAmt, $premAmt, $charger)
|
||||
{
|
||||
$url = $this->commonModel->getCompanyInfo(3);
|
||||
$url = $url['api_server'] . "/confirms/priceChange";
|
||||
|
||||
$postData = [
|
||||
"atclNo" => $atclNo,
|
||||
"dealAmt" => $dealAmt,
|
||||
"wrrntAmt" => $wrrntAmt,
|
||||
"leaseAmt" => $leaseAmt,
|
||||
"isaleAmt" => $isaleAmt,
|
||||
"premAmt" => $premAmt,
|
||||
"charger" => $charger
|
||||
];
|
||||
|
||||
return $this->request('POST', $url, $postData);
|
||||
}
|
||||
|
||||
/**
|
||||
* 매물정보수정
|
||||
* @param String atclNo 매물번호
|
||||
* @param integer hscpNo 단지번호
|
||||
* @param integer ptpNo 평형번호
|
||||
* @param String bildNm 동이름
|
||||
* @param String rmNo 호수
|
||||
* @param String tradeType 거래종류(A1,B1,B2 / 변경시 B1 <-> B2만 가능)
|
||||
* @param integer dealAmt 매매가, 전세(보증금) 단위 : 만원
|
||||
* @param integer wrrntAmt 전세가(보증금) 단위 : 만원
|
||||
* @param integer leaseAmt 월세가 단위 : 만원
|
||||
* @param integer isaleAmt 분양가 단위 : 만원
|
||||
* @param integer premAmt 프리미엄 단위 : 만원
|
||||
* @param integer floor 층
|
||||
* @param integer charger 담당자id
|
||||
*
|
||||
* @param String addressCode 주소코드 : 비공동 주택 법정동 코드
|
||||
* @param String address2 지번주소 : 비공동 주택 지번 주소
|
||||
* @param String address3 기타주소 : 비공동 주택 기타 주소
|
||||
* @param float splySpc 공급면적
|
||||
* @param float exclsSpc 대지면적
|
||||
* @param float totSpc 전체면적
|
||||
* @param float grndSpc 대지면적
|
||||
* @param float bldgSpc 건축면적
|
||||
*
|
||||
*/
|
||||
public function modifyInfo($atclNo, $hscpNo, $ptpNo, $bildNm, $rmNo, $tradeType, $dealAmt, $wrrntAmt, $leaseAmt, $isaleAmt, $premAmt, $floor, $floor2, $charger, $addressCode, $address2, $address2a, $address2b, $address3, $splySpc, $exclsSpc, $totSpc, $grndSpc, $bldgSpc)
|
||||
{
|
||||
$url = $this->commonModel->getCompanyInfo(3);
|
||||
$url = $url['api_server'] . "/confirms/modifyInfo";
|
||||
|
||||
// 공통
|
||||
$postData = [
|
||||
"atclNo" => $atclNo,
|
||||
"tradeType" => $tradeType,
|
||||
"dealAmt" => $dealAmt,
|
||||
"wrrntAmt" => $wrrntAmt,
|
||||
"leaseAmt" => $leaseAmt,
|
||||
"isaleAmt" => $isaleAmt,
|
||||
"charger" => $charger
|
||||
];
|
||||
|
||||
// 공동주택
|
||||
$apartData["hscpNo"] = $hscpNo;
|
||||
$apartData["ptpNo"] = $ptpNo;
|
||||
$apartData["bildNm"] = $address2; // 네이버에서 보내주는거랑 수정되어 전달하는 거랑 다른 타입임. 2014년 11월 13일 수정
|
||||
$apartData["rmNo"] = $address3; // 네이버에서 보내주는거랑 수정되어 전달하는 거랑 다른 타입임. 2014년 11월 13일 수정
|
||||
// $apartData["bildNm"] = $bildNm;
|
||||
// $apartData["rmNo"] = $rmNo;
|
||||
$apartData["premAmt"] = $premAmt;
|
||||
$apartData["floor"] = $floor;
|
||||
$apartData["floor2"] = $floor2;
|
||||
|
||||
// 비공동주택 연동
|
||||
$detachData["addressCode"] = $addressCode;
|
||||
$detachData["address2"] = $address2;
|
||||
$detachData["address2a"] = $address2a;
|
||||
$detachData["address2b"] = $address2b;
|
||||
$detachData["address3"] = $address3;
|
||||
$detachData["splySpc"] = $splySpc;
|
||||
$detachData["exclsSpc"] = $exclsSpc;
|
||||
$detachData["totSpc"] = $totSpc;
|
||||
$detachData["grndSpc"] = $grndSpc;
|
||||
$detachData["bldgSpc"] = $bldgSpc;
|
||||
$detachData["floor"] = $floor;
|
||||
$detachData["floor2"] = $floor2;
|
||||
|
||||
if (!empty($hscpNo)) { //공동주택일 때
|
||||
$postData = array_merge($postData, $apartData);
|
||||
} else { //비공동주택일 때
|
||||
$postData = array_merge($postData, $detachData);
|
||||
}
|
||||
|
||||
return $this->request('POST', $url, $postData);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 검증결과 전송
|
||||
* @param String atclNo 매물번호
|
||||
* @param boolean success 성공여부
|
||||
* @param array checkList 확인정보 array('type'=>'T11','code'=>'10000','comment'=>'01|02|03'); 또는 array('type'=>'T11','code'=>'10000','comment'=>'코멘트');
|
||||
* @param String charger 담당자 사번
|
||||
* @param array modifyInfo 공동 비공동에 따라 다른 배열을 넘긴다.
|
||||
* @param String date 상담일시
|
||||
*/
|
||||
public function confirm($atclNo, $success, $checkList, $charger, $modifyInfo, $date)
|
||||
{
|
||||
$url = $this->commonModel->getCompanyInfo(3);
|
||||
$url = $url['api_server'] . "/confirms/confirm";
|
||||
|
||||
$postData = [
|
||||
"atclNo" => $atclNo,
|
||||
"success" => $success,
|
||||
"checkList" => $checkList,
|
||||
"charger" => $charger,
|
||||
"modifyInfo" => $modifyInfo,
|
||||
"date" => $date,
|
||||
];
|
||||
|
||||
return $this->request('POST', $url, $postData);
|
||||
}
|
||||
|
||||
/**
|
||||
* 등기부 등본 확인 결과
|
||||
* @param String atclNo 매물번호
|
||||
* @param String type 1: 1차 확인(등기부확인) / 2: 2차 확인(최종확인 또는 중개업소 TM)
|
||||
* @param boolean success 성공여부
|
||||
* @param array checkList 확인정보
|
||||
* @param String charger 담당자 사번
|
||||
* @param String date 상담일시
|
||||
* @param array modifyInfo 수정정보 - success:true 에서만 허용
|
||||
*/
|
||||
public function certification($atclNo, $type, $success, $checkList, $charger, $date, $modifyInfo, $ownerVerifiable)
|
||||
{
|
||||
$url = $this->commonModel->getCompanyInfo(3);
|
||||
$url = $url['api_server'] . "/confirms/certification";
|
||||
|
||||
$postData = [
|
||||
"atclNo" => $atclNo,
|
||||
"type" => $type,
|
||||
"success" => $success,
|
||||
"checkList" => $checkList,
|
||||
"charger" => $charger,
|
||||
"date" => $date,
|
||||
"modifyInfo" => $modifyInfo,
|
||||
"ownerVerifiable" => $ownerVerifiable
|
||||
];
|
||||
|
||||
return $this->request('POST', $url, $postData);
|
||||
}
|
||||
|
||||
/**
|
||||
* CURL 공통 실행 함수
|
||||
*/
|
||||
|
||||
@@ -17,4 +17,12 @@ class CommonModel extends Model
|
||||
|
||||
return $query->getResultArray();
|
||||
}
|
||||
|
||||
public function getCompanyInfo($compSq)
|
||||
{
|
||||
$sql = "SELECT api_server, api_key, comp_nm FROM companies WHERE comp_sq = ?";
|
||||
$data = [$compSq];
|
||||
$query = $this->db->query($sql, $data);
|
||||
return $query->getRowArray();
|
||||
}
|
||||
}
|
||||
@@ -191,6 +191,42 @@ class M415Model extends Model
|
||||
return $res;
|
||||
}
|
||||
|
||||
// 서류/전화 확인완료 시간 = 등기부등본 확인중 시간
|
||||
public function getConfTimeForHistory($vr_sq)
|
||||
{
|
||||
$sql = "select insert_tm from v2_chg_history" .
|
||||
" where vr_sq = ?" .
|
||||
" and stat_cd = '35'" .
|
||||
" and chg_type= 'C9'" .
|
||||
" order by seq desc" .
|
||||
" limit 1";
|
||||
$data = array(
|
||||
$vr_sq
|
||||
);
|
||||
$query = $this->db->query($sql, $data);
|
||||
$res = $query->getRowArray();
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
// 검증완료 시간
|
||||
public function get_60_ForHistory($vr_sq)
|
||||
{
|
||||
$sql = "select insert_tm from v2_chg_history" .
|
||||
" where vr_sq = ?" .
|
||||
" and stat_cd = '60'" .
|
||||
" and chg_type= 'C9'" .
|
||||
" order by seq desc" .
|
||||
" limit 1";
|
||||
$data = array(
|
||||
$vr_sq
|
||||
);
|
||||
$query = $this->db->query($sql, $data);
|
||||
$res = $query->getRowArray();
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
// 등기부등본 확인중 시간, 서류에서 등기로 넘어갈때 간혹 서류전화 확인 완료가 안찍히는 건들이 있다
|
||||
public function get_cert_ing_TimeForHistory($vr_sq)
|
||||
{
|
||||
@@ -338,4 +374,196 @@ class M415Model extends Model
|
||||
);
|
||||
$this->db->query($sql, $data);
|
||||
}
|
||||
|
||||
//전화확인 - 통화실패 카운트
|
||||
public function getCallfailForHistory($vr_sq)
|
||||
{
|
||||
$sql = "SELECT 'x' from v2_chg_history" .
|
||||
" WHERE vr_sq = ?" .
|
||||
" AND chg_type= 'C29'" .
|
||||
" ORDER BY seq desc" .
|
||||
" LIMIT 1";
|
||||
$data = array(
|
||||
$vr_sq
|
||||
);
|
||||
$query = $this->db->query($sql, $data);
|
||||
$res = $query->getRowArray();
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
// 서류/전화 인입시간
|
||||
public function getSaveTimeForHistory($vr_sq)
|
||||
{
|
||||
$sql = "select insert_tm from v2_chg_history" .
|
||||
" where vr_sq = ?" .
|
||||
" and stat_cd = '30'" .
|
||||
" and chg_type= 'C9'" .
|
||||
" order by seq desc" .
|
||||
" limit 1";
|
||||
$data = array(
|
||||
$vr_sq
|
||||
);
|
||||
$query = $this->db->query($sql, $data);
|
||||
|
||||
$res = $query->getRowArray();
|
||||
return $res;
|
||||
}
|
||||
|
||||
// 등기부등본 확인실패 시간
|
||||
public function get_cert_failTimeForHistory($vr_sq)
|
||||
{
|
||||
$sql = "select insert_tm from v2_chg_history" .
|
||||
" where vr_sq = ?" .
|
||||
" and stat_cd = '49'" .
|
||||
" and chg_type= 'C9'" .
|
||||
" order by seq desc" .
|
||||
" limit 1";
|
||||
$data = array(
|
||||
$vr_sq
|
||||
);
|
||||
$query = $this->db->query($sql, $data);
|
||||
$res = $query->getRowArray();
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
//등기부등본 확인완료(모바일)
|
||||
public function insert_v2_time_required_M($atcl_no, $cpid, $vrfc_type, $insert_tm, $cert_comple_dt, $finishTime)
|
||||
{
|
||||
if (substr($insert_tm, 0, 10) == substr($cert_comple_dt, 0, 10)) {
|
||||
if (('12:00:00' < substr($insert_tm, -8)) && (substr($insert_tm, -8) < '13:00:00')) {//접수시간이 12~13시 사이면 13시로 해준다
|
||||
if ($cert_comple_dt > '13:00:00') { //검증완료가 13시 '이후'에 끝나면 접수시간을 13시로 변경해준다
|
||||
$insert_tm = date("Y-m-d", time()) . " 13:00:00";
|
||||
}
|
||||
} else if (
|
||||
(substr($insert_tm, -8) > '17:30:00' || substr($insert_tm, -8) < '08:59:59') && //접수와 확인완료시간이 모두 17:30:00 ~ 09:00:00 사이가 아니면
|
||||
(substr($cert_comple_dt, -8) < '17:30:00' || substr($cert_comple_dt, -8) < '08:59:59')
|
||||
) {
|
||||
$insert_tm = date("Y-m-d", time()) . " 09:00:00";
|
||||
}
|
||||
} else {
|
||||
if (substr($insert_tm, -8) > '17:30:00' || substr($insert_tm, -8) < '08:59:59') {
|
||||
$insert_tm = date("Y-m-d", time()) . " 09:00:00";
|
||||
}
|
||||
}
|
||||
$stan_date = substr($insert_tm, 0, 10);
|
||||
|
||||
$sql = "INSERT INTO v2_time_required(stan_date, atcl_no, cpid, vrfc_type, insert_tm, cert_comple_dt, cert_required_tm, tot_required_tm)" .
|
||||
" VALUES(?, ?, ?, ?, ?, ?, TIMEDIFF(?,?), TIMEDIFF(?,?)) " .
|
||||
" ON DUPLICATE KEY UPDATE insert_tm = VALUES(insert_tm), tel_doc_conf_dt=VALUES(tel_doc_conf_dt),conf_required_tm = VALUES(conf_required_tm),tot_required_tm = VALUES(tot_required_tm) ";
|
||||
$data = array(
|
||||
$stan_date,
|
||||
$atcl_no,
|
||||
$cpid,
|
||||
$vrfc_type,
|
||||
$insert_tm,
|
||||
$cert_comple_dt,
|
||||
$cert_comple_dt,
|
||||
$insert_tm,
|
||||
$cert_comple_dt,
|
||||
$insert_tm
|
||||
);
|
||||
$this->db->query($sql, $data);
|
||||
}
|
||||
|
||||
//등기부등본 확인완료(불일치)
|
||||
public function update_v2_time_required_Conf($atcl_no, $cpid, $vrfc_type, $tel_doc_conf_dt, $cert_comple_dt, $sf)
|
||||
{
|
||||
if ($sf == 'F') {
|
||||
if (substr($tel_doc_conf_dt, 0, 10) == substr($cert_comple_dt, 0, 10)) {
|
||||
if (('12:00:00' < substr($tel_doc_conf_dt, -8)) && (substr($tel_doc_conf_dt, -8) < '13:00:00')) {//전서확인시간이 12~13시 사이면 13시로 해준다
|
||||
// if (substr($finishTime, -8) > '13:00:00'){ //등본완료가 13시 '이후'에 끝나면 전서확인시간을 13시로 변경해준다
|
||||
// $tel_doc_conf_dt = date("Y-m-d",time())." 13:00:00";
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
$sql = "UPDATE v2_time_required " .
|
||||
" SET cert_comple_dt = ?" .
|
||||
" ,cert_required_tm = TIMEDIFF(?,?)" .//등본 소요시간 = 등본완료시간-전/서확인완료시간
|
||||
" WHERE atcl_no = ?";
|
||||
$data = array(
|
||||
$cert_comple_dt,
|
||||
$cert_comple_dt,
|
||||
$tel_doc_conf_dt,
|
||||
$atcl_no
|
||||
);
|
||||
$this->db->query($sql, $data);
|
||||
// echo $this->db->last_query().'<br>';
|
||||
}
|
||||
|
||||
// 최초! 등기부등본 확인중 시간-모바일용
|
||||
public function get_cert_M_timeForHistory($vr_sq)
|
||||
{
|
||||
$sql = "select insert_tm from v2_chg_history" .
|
||||
" where vr_sq = ?" .
|
||||
" and stat_cd = '40'" .
|
||||
" and chg_type= 'C9'" .
|
||||
" limit 1";
|
||||
$data = array(
|
||||
$vr_sq
|
||||
);
|
||||
$query = $this->db->query($sql, $data);
|
||||
$res = $query->getRowArray();
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
// 검증실패 시간
|
||||
public function get_69_ForHistory($vr_sq)
|
||||
{
|
||||
$sql = "select insert_tm from v2_chg_history" .
|
||||
" where vr_sq = ?" .
|
||||
" and stat_cd = '69'" .
|
||||
" and chg_type= 'C9'" .
|
||||
" order by seq desc" .
|
||||
" limit 1";
|
||||
$data = array(
|
||||
$vr_sq
|
||||
);
|
||||
$query = $this->db->query($sql, $data);
|
||||
$res = $query->getRowArray();
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
//등기부등본 확인완료(일치/불일치), 검증완료/실패까지 갈때만!
|
||||
public function update_v2_time_required_Conf_Done($atcl_no, $cpid, $vrfc_type, $tel_doc_conf_dt, $cert_comple_dt)
|
||||
{
|
||||
//1.검증소요시간 가져온다
|
||||
$sql = "SELECT conf_required_tm" .
|
||||
" FROM v2_time_required" .
|
||||
" WHERE atcl_no = ?";
|
||||
$data = array(
|
||||
$atcl_no
|
||||
);
|
||||
$query = $this->db->query($sql, $data);
|
||||
|
||||
$res = $query->row_array();
|
||||
|
||||
if (substr($tel_doc_conf_dt, 0, 10) == substr($cert_comple_dt, 0, 10)) {
|
||||
if (('12:00:00' < substr($tel_doc_conf_dt, -8)) && (substr($tel_doc_conf_dt, -8) < '13:00:00')) {//전서확인시간이 12~13시 사이면 13시로 해준다
|
||||
if (substr($cert_comple_dt, -8) > '13:00:00') { //등본완료가 13시 '이후'에 끝나면 전서확인시간을 13시로 변경해준다
|
||||
$tel_doc_conf_dt = date("Y-m-d", time()) . " 13:00:00";
|
||||
}
|
||||
}
|
||||
}
|
||||
//2.등본소요시간, 등본완료시간, 총소요시간을 넣는다
|
||||
$sql = "UPDATE v2_time_required " .
|
||||
" SET cert_comple_dt = ?" .
|
||||
" ,cert_required_tm = TIMEDIFF(?,?)" . //등본 소요시간 = 등본완료시간-전/서확인완료시간
|
||||
" ,tot_required_tm = ADDTIME(?,TIMEDIFF(?,?))" .//총소요시간 = 검증소요시간+등본소요시간
|
||||
" WHERE atcl_no = ?";
|
||||
$data = array(
|
||||
$cert_comple_dt,
|
||||
$cert_comple_dt,
|
||||
$tel_doc_conf_dt,
|
||||
$res['conf_required_tm'],
|
||||
$cert_comple_dt,
|
||||
$tel_doc_conf_dt,
|
||||
$atcl_no
|
||||
);
|
||||
$this->db->query($sql, $data);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
namespace App\Models\v2;
|
||||
|
||||
use App\Models\webfax\FaxModel;
|
||||
use CodeIgniter\Model;
|
||||
|
||||
class M701Model extends Model
|
||||
@@ -887,6 +888,179 @@ class M701Model extends Model
|
||||
}
|
||||
|
||||
|
||||
// 가격수정
|
||||
public function changePrice($param)
|
||||
{
|
||||
$this->db->transStart();
|
||||
|
||||
$usr_id = session('usr_id');
|
||||
|
||||
$detail = $this->getDetail($param['rcpt_key']);
|
||||
|
||||
if ($param['trade_type'] != 'B2') {
|
||||
// 월세가 아닐경우에는 월세가에 0으로 ....
|
||||
$data['lease_amt'] = $param['atcl_amt3'];
|
||||
}
|
||||
|
||||
if (!empty($param['atcl_amt1']))
|
||||
$data['deal_amt'] = $param['atcl_amt1'];
|
||||
if (!empty($param['atcl_amt2']))
|
||||
$data['wrrnt_amt'] = $param['atcl_amt2'];
|
||||
if (!empty($param['atcl_amt3']))
|
||||
$data['lease_amt'] = $param['atcl_amt3']; // 월세이고 월세가격이 입력되지 않았으면... 원래 금액으로
|
||||
if (!empty($param['atcl_amt4']))
|
||||
$data['deal_amt'] = $param['atcl_amt4'];
|
||||
if (!empty($param['isale_amt']))
|
||||
$data['isale_amt'] = $param['isale_amt'];
|
||||
if (!empty($param['prem_amt']))
|
||||
$data['prem_amt'] = $param['prem_amt'];
|
||||
|
||||
$data['modify_yn'] = 'Y';
|
||||
|
||||
$builder = $this->db->table('v2_modify_info');
|
||||
$ok = $builder->where('vr_sq', $param['rcpt_key'])->update($data);
|
||||
if ($ok === false) {
|
||||
return [
|
||||
'success' => false,
|
||||
'msg' => '저장 실패',
|
||||
];
|
||||
}
|
||||
|
||||
$memo = "가격변경 ";
|
||||
$this->saveHistory($detail['vr_sq'], $detail['pre_stat_cd'], 'C25', $usr_id, $memo);
|
||||
|
||||
$this->db->transComplete();
|
||||
|
||||
return [
|
||||
'success' => true,
|
||||
];
|
||||
}
|
||||
|
||||
// 정보수정
|
||||
public function modifyInfo($atcl_vr_sq, $atcl_hscp_nm, $atcl_ptp_nm, $atcl_vrfc_type, $trade_type, $atcl_addr1, $atcl_addr1a, $atcl_addr1b, $atcl_addr2, $atcl_hscp_no, $atcl_ptp_no, $atcl_amt1, $atcl_amt2, $atcl_amt3, $atcl_floor, $atcl_floor2, $atcl_amt4, $isale_amt, $prem_amt)
|
||||
{
|
||||
$this->db->transStart();
|
||||
|
||||
$usr_id = session('usr_id');
|
||||
|
||||
$detail = $this->getDetail($atcl_vr_sq);
|
||||
|
||||
if ($trade_type != 'B2') {
|
||||
// 월세가 아닐경우에는 월세가에 0으로 ....
|
||||
$atcl_amt3 = '0';
|
||||
$data['lease_amt'] = $atcl_amt3;
|
||||
}
|
||||
if (!empty($trade_type))
|
||||
$data['trade_type'] = $trade_type;
|
||||
if (!empty($atcl_hscp_nm))
|
||||
$data['hscp_nm'] = $atcl_hscp_nm;
|
||||
if (!empty($atcl_ptp_nm))
|
||||
$data['ptp_nm'] = $atcl_ptp_nm;
|
||||
if (!empty($atcl_addr1))
|
||||
$data['address2'] = $atcl_addr1; // 폐기 예정
|
||||
if (!empty($atcl_addr1a))
|
||||
$data['address2a'] = $atcl_addr1a;
|
||||
if (!empty($atcl_addr1b))
|
||||
$data['address2b'] = $atcl_addr1b;
|
||||
if (!empty($atcl_addr2))
|
||||
$data['address3'] = $atcl_addr2;
|
||||
if (!empty($atcl_hscp_no))
|
||||
$data['hscp_no'] = $atcl_hscp_no;
|
||||
if (!empty($atcl_ptp_no))
|
||||
$data['ptp_no'] = $atcl_ptp_no;
|
||||
if (!empty($atcl_amt1))
|
||||
$data['deal_amt'] = $atcl_amt1;
|
||||
if (!empty($atcl_amt2))
|
||||
$data['wrrnt_amt'] = $atcl_amt2;
|
||||
if (!empty($atcl_amt3))
|
||||
$data['lease_amt'] = $atcl_amt3; // 월세이고 월세가격이 입력되지 않았으면... 원래 금액으로
|
||||
if (!empty($atcl_amt4))
|
||||
$data['deal_amt'] = $atcl_amt4;
|
||||
if (!empty($isale_amt))
|
||||
$data['isale_amt'] = $isale_amt;
|
||||
if (!empty($prem_amt))
|
||||
$data['prem_amt'] = $prem_amt;
|
||||
if (!empty($atcl_floor))
|
||||
$data['floor'] = $atcl_floor;
|
||||
if (!empty($atcl_floor2))
|
||||
$data['floor2'] = $atcl_floor2;
|
||||
$data['modify_yn'] = 'Y';
|
||||
|
||||
$builder = $this->db->table('v2_modify_info');
|
||||
$ok = $builder->where('vr_sq', $atcl_vr_sq)->update($data);
|
||||
if ($ok === false) {
|
||||
return [
|
||||
'success' => false,
|
||||
'msg' => '저장 실패',
|
||||
];
|
||||
}
|
||||
|
||||
$last_query = $this->db->getLastQuery();
|
||||
$current_url = current_url();
|
||||
|
||||
|
||||
$memo = "상세정보수정 ";
|
||||
$this->saveHistory(vr_sq: $detail['vr_sq'], stat_cd: $detail['pre_stat_cd'], chg_type: 'C25', usr_id: $usr_id, memo: $memo);
|
||||
|
||||
$faxModel = new FaxModel();
|
||||
$faxModel->updateAddress($atcl_vr_sq, $detail['address_code'], $data['address2'], $data['address3'], $data['hscp_no'], $data['hscp_nm']);
|
||||
|
||||
|
||||
$this->db->transComplete();
|
||||
|
||||
return [
|
||||
'success' => true,
|
||||
];
|
||||
|
||||
}
|
||||
|
||||
public function saveModifyVrfc($atcl_vr_sq, $atcl_vrfc_type)
|
||||
{
|
||||
|
||||
$usr_id = session('usr_id');
|
||||
|
||||
$list = $this->get_detail($atcl_vr_sq); //변경된 내용 비교를 위해.
|
||||
|
||||
$data['vrfc_type'] = $atcl_vrfc_type;
|
||||
|
||||
$this->db->where('vr_sq', $atcl_vr_sq);
|
||||
$this->db->trans_start();
|
||||
$this->db->update('v2_vrfc_req', $data);
|
||||
|
||||
$data['vrfc_type_cd'] = $atcl_vrfc_type;
|
||||
$return['error_number'] = $this->db->_error_number();
|
||||
$return['error_message'] = $this->db->_error_message();
|
||||
|
||||
if (empty($return['error_number'])) {
|
||||
// 로그를 남긴다.
|
||||
if ($this->db->affected_rows() > 0) {
|
||||
// $changed = $this->what_is_changed($list['data'], $data, $atcl_vr_sq);
|
||||
if (!empty($changed)) {
|
||||
$this->saveHistory($list['data']['vr_sq'], $list['data']['pre_stat_cd'], 'C25', $usr_id, "상세정보 수정");
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->db->transComplete();
|
||||
return $return;
|
||||
}
|
||||
|
||||
public function saveApiErr($err_sq, $err_code, $err_nm, $err_time, $err_no, $err_server = '')
|
||||
{
|
||||
$sql = "INSERT INTO err_api (err_sq, err_code, err_nm, err_time, err_no, err_server)" .
|
||||
" VALUES (?, ?, ?, ?, ?, ?);";
|
||||
|
||||
$data = [
|
||||
$err_sq,
|
||||
$err_code,
|
||||
$err_nm,
|
||||
$err_time,
|
||||
$err_no,
|
||||
$err_server
|
||||
];
|
||||
|
||||
$this->db->query($sql, $data);
|
||||
}
|
||||
|
||||
// 상태변경
|
||||
public function chgArticleStatus($data)
|
||||
{
|
||||
@@ -961,6 +1135,601 @@ class M701Model extends Model
|
||||
];
|
||||
}
|
||||
|
||||
// 현재상태확인
|
||||
public function chkStat($vr_sq)
|
||||
{
|
||||
$sql = "SELECT stat_cd FROM v2_vrfc_req WHERE vr_sq = ?";
|
||||
$data = [
|
||||
$vr_sq
|
||||
];
|
||||
$query = $this->db->query($sql, $data);
|
||||
return $query->getRowArray();
|
||||
}
|
||||
|
||||
public function chkTryCnt($vr_sq)
|
||||
{
|
||||
$columns = 'a.try_cnt';
|
||||
$builder = $this->db->table('v2_vrfc_req a');
|
||||
$builder->select($columns);
|
||||
$builder->where('vr_sq', $vr_sq);
|
||||
$query = $builder->get();
|
||||
|
||||
return $query->getRowArray();
|
||||
}
|
||||
|
||||
public function chkRegiTryCnt($atcl_vr_sq)
|
||||
{ //1차 검증인지 2차 검증인지 확인.
|
||||
$builder = $this->db->table('v2_vrfc_req a');
|
||||
$builder->select('a.reg_try_cnt');
|
||||
$builder->where('vr_sq', $atcl_vr_sq);
|
||||
$query = $builder->get();
|
||||
|
||||
return $query->getRowArray();
|
||||
}
|
||||
|
||||
public function chkConfirm($vr_sq, $reg_yn)
|
||||
{
|
||||
$columns = "a.vr_sq";
|
||||
$builder = $this->db->table('v2_confirm a');
|
||||
$builder->select($columns);
|
||||
$builder->where('vr_sq', $vr_sq);
|
||||
|
||||
if ($reg_yn) {
|
||||
$builder->where('vrfc_type', $reg_yn); // 등기부등본 정보 확인시
|
||||
}
|
||||
|
||||
$query = $builder->get();
|
||||
$result = $query->getNumRows();
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function insertConfirm($vr_sq, $vrfc_type, $success, $type, $usr_id = '', $usr_sq = '')
|
||||
{
|
||||
if (empty($usr_sq))
|
||||
$usr_sq = session('usr_sq');
|
||||
if (empty($usr_id))
|
||||
$usr_id = session('usr_id');
|
||||
|
||||
$sql = "INSERT INTO v2_confirm" .
|
||||
"(vr_sq, vrfc_type, success, type, charger, date, insert_user, insert_tm, update_user, update_tm)" .
|
||||
"VALUES" .
|
||||
"(?, ?, ?, ?, ?, '" . date('YmdHis') . "', ?, NOW(), ?, NOW()) " .
|
||||
" ON DUPLICATE KEY UPDATE" .
|
||||
" success=values(success), charger=values(charger)
|
||||
, date=values(date), update_user=values(update_user), update_tm=values(update_tm)";
|
||||
|
||||
$data = [
|
||||
$vr_sq,
|
||||
$vrfc_type,
|
||||
$success,
|
||||
$type,
|
||||
$usr_id,
|
||||
$usr_sq,
|
||||
$usr_sq
|
||||
];
|
||||
|
||||
$this->db->query($sql, $data);
|
||||
}
|
||||
public function updateConfirm($vr_sq, $vrfc_type, $success)
|
||||
{
|
||||
$data = [
|
||||
'success' => $success,
|
||||
];
|
||||
|
||||
$builder = $this->db->table('v2_confirm');
|
||||
$builder->where('vr_sq', $vr_sq);
|
||||
$builder->where('vrfc_type', $vrfc_type);
|
||||
$builder->update($data);
|
||||
}
|
||||
|
||||
public function chgRegiTryCnt($vr_sq, $try_cnt)
|
||||
{ //v2_vrfc_req try_cnt 값 변경.
|
||||
$sql = "UPDATE v2_vrfc_req" .
|
||||
" SET reg_try_cnt = ?" .
|
||||
" WHERE vr_sq = ?";
|
||||
|
||||
$data = array(
|
||||
$try_cnt,
|
||||
$vr_sq
|
||||
);
|
||||
|
||||
$this->db->query($sql, $data);
|
||||
}
|
||||
|
||||
public function chgStat($vr_sq, $stat_cd, $insert_tm)
|
||||
{
|
||||
$usr_sq = session('usr_sq');
|
||||
$usr_id = session('usr_id');
|
||||
|
||||
$list = $this->getDetail($vr_sq);
|
||||
|
||||
$this->db->transStart();
|
||||
|
||||
$sql = "INSERT INTO v2_chg_stat (vr_sq, stat_cd, insert_user, insert_tm)
|
||||
VALUES (?, ?, ?, ?)
|
||||
ON DUPLICATE KEY UPDATE
|
||||
vr_sq = VALUES(vr_sq),
|
||||
stat_cd = VALUES(stat_cd),
|
||||
insert_user = VALUES(insert_user),
|
||||
insert_tm = VALUES(insert_tm)";
|
||||
|
||||
$data = [
|
||||
$vr_sq,
|
||||
$stat_cd,
|
||||
$usr_sq,
|
||||
$insert_tm,
|
||||
];
|
||||
|
||||
if ($this->db->query($sql, $data) === false) {
|
||||
return [
|
||||
'success' => false,
|
||||
'msg' => '저장 실패',
|
||||
];
|
||||
}
|
||||
|
||||
$this->saveHistory($list['vr_sq'], $stat_cd, 'C9', $usr_id, '서류확인 정보 변경');
|
||||
|
||||
$this->db->transComplete();
|
||||
|
||||
return [
|
||||
'success' => true,
|
||||
];
|
||||
}
|
||||
|
||||
public function chgStatVrfc($vr_sq, $stat_cd)
|
||||
{
|
||||
$data = [
|
||||
'stat_cd' => $stat_cd,
|
||||
];
|
||||
|
||||
$builder = $this->db->table('v2_vrfc_req');
|
||||
$builder->where('vr_sq', $vr_sq);
|
||||
$builder->update($data);
|
||||
}
|
||||
|
||||
public function chgStatFax($vr_sq, $stat_cd)
|
||||
{
|
||||
$data = [
|
||||
'stat_cd' => $stat_cd,
|
||||
];
|
||||
|
||||
$builder = $this->db->table('fax_imgs');
|
||||
$builder->where('vr_sq', $vr_sq);
|
||||
$builder->update($data);
|
||||
}
|
||||
|
||||
|
||||
// 파일정보 저장
|
||||
public function saveFileInfo($file)
|
||||
{
|
||||
$this->db->transStart();
|
||||
|
||||
$fileType = $file['file_type'] ?? '1';
|
||||
|
||||
// 기존 파일 확인
|
||||
$sql = "SELECT seq FROM v2_files WHERE vr_sq = ? AND use_yn = 'Y' AND file_type = ?";
|
||||
$query = $this->db->query($sql, [$file['vr_sq'], $fileType]);
|
||||
$result = $query->getRow();
|
||||
|
||||
if (!empty($result)) {
|
||||
// 기존 파일을 비활성화
|
||||
$sql = "UPDATE v2_files SET use_yn = 'N' WHERE vr_sq = ? AND file_type = ?";
|
||||
$this->db->query($sql, [$file['vr_sq'], $fileType]);
|
||||
}
|
||||
|
||||
// 새 파일 정보 INSERT
|
||||
$data = [
|
||||
'vr_sq' => $file['vr_sq'],
|
||||
'use_yn' => 'Y',
|
||||
'file_type' => $fileType,
|
||||
'view_odr' => $file['view_odr'] ?? 0,
|
||||
'file_path' => $file['file_path'],
|
||||
'file_name' => $file['new_name'],
|
||||
'file_ext' => $file['ext'],
|
||||
'file_size' => $file['size'],
|
||||
'insert_user' => session('usr_sq'),
|
||||
'insert_tm' => date('Y-m-d H:i:s'),
|
||||
'cloud_upload_yn' => 'Y',
|
||||
];
|
||||
|
||||
$builder = $this->db->table('v2_files');
|
||||
$builder->insert($data);
|
||||
|
||||
$this->db->transComplete();
|
||||
}
|
||||
|
||||
public function insertChkList($vr_sq, $vrfc_type, $type, $code, $comment)
|
||||
{
|
||||
if (is_array($comment)) {
|
||||
$comment = implode('|', $comment);
|
||||
}
|
||||
|
||||
$usr_sq = $this->session->userdata('usr_sq');
|
||||
$sql = "INSERT INTO v2_check_list" .
|
||||
"(vr_sq, vrfc_type, type, code, comment, insert_user, insert_tm)" .
|
||||
"VALUES" .
|
||||
"(?, ?, ?, ?, ?, ?, NOW())" .
|
||||
" ON DUPLICATE KEY UPDATE" .
|
||||
" vr_sq=values(vr_sq), vrfc_type=values(vrfc_type), type=values(type), code=values(code), comment=values(comment), insert_user=values(insert_user), insert_tm=values(insert_tm)";
|
||||
|
||||
$data = [
|
||||
$vr_sq,
|
||||
$vrfc_type,
|
||||
$type,
|
||||
$code,
|
||||
$comment,
|
||||
$usr_sq
|
||||
];
|
||||
|
||||
|
||||
$res = $this->db->query($sql, $data);
|
||||
}
|
||||
|
||||
public function chgTryCnt($vr_sq, $try_cnt)
|
||||
{ //v2_vrfc_req try_cnt 값 변경.
|
||||
$sql = "UPDATE v2_vrfc_req" .
|
||||
" SET try_cnt = ?" .
|
||||
" WHERE vr_sq = ?";
|
||||
|
||||
$data = array(
|
||||
$try_cnt,
|
||||
$vr_sq
|
||||
);
|
||||
|
||||
$this->db->query($sql, $data);
|
||||
}
|
||||
|
||||
public function InsResChar($atcl_vr_sq)
|
||||
{
|
||||
$usr_id = session('usr_id');
|
||||
|
||||
$sql = "UPDATE v2_article_info" .
|
||||
" SET reg_charger = ?" .
|
||||
" WHERE vr_sq = ?";
|
||||
|
||||
$data = array(
|
||||
$usr_id,
|
||||
$atcl_vr_sq
|
||||
);
|
||||
$res = $this->db->query($sql, $data);
|
||||
$log_v = $this->db->getLastQuery();
|
||||
log_message('debug', $log_v);
|
||||
}
|
||||
|
||||
/**
|
||||
* 검증결과 전송 API를 위한 데이터 조회..
|
||||
*/
|
||||
public function getDataConfirmAPI($vr_sq)
|
||||
{
|
||||
// 요청정보
|
||||
$sql = "SELECT vr_sq, atcl_no, step, cpid, cp_atcl_id, trade_type, realtor_nm, realtor_tel_no, seller_tel_no, vrfc_type, rgbk_confirm, req_type, rdate, stat_cd, try_cnt, insert_user, insert_tm
|
||||
FROM v2_vrfc_req WHERE vr_sq = ?";
|
||||
$query = $this->db->query($sql, [$vr_sq]);
|
||||
$rowVrfcReq = $query->getRowArray();
|
||||
|
||||
log_message('debug', $this->db->getLastQuery());
|
||||
|
||||
// 매물정보
|
||||
$sql = "SELECT vr_sq, atcl_no, cpid, cp_atcl_id, rlet_type_cd, trade_type, address_code, address1, address2, address3, sply_spc, excls_spc, tot_spc, grnd_spc, bldg_spc, deal_amt, wrrnt_amt, lease_amt, isale_amt, prem_amt, sise, floor, rdate, seller_tel_no, seller_nm, realtor_nm, realtor_tel_no, hscp_no, hscp_nm, ptp_no, ptp_nm, charger, req_price_yn, reg_charger, dept1_sq, dept2_sq, reg_dept1_sq, reg_dept2_sq, floor2
|
||||
FROM v2_article_info WHERE vr_sq = ?";
|
||||
$query = $this->db->query($sql, [$vr_sq]);
|
||||
$rowArticleInfo = $query->getRowArray();
|
||||
|
||||
log_message('debug', $this->db->getLastQuery());
|
||||
|
||||
// 수정정보
|
||||
$sql = "SELECT vr_sq, bild_nm, rm_no, floor, address_code, address2, address3, address4, trade_type, deal_amt, wrrnt_amt, lease_amt, isale_amt, prem_amt, sply_spc, excls_spc, tot_spc, grnd_spc, bldg_spc, hscp_no, hscp_nm, ptp_no, ptp_nm, modify_yn, floor2
|
||||
FROM v2_modify_info WHERE vr_sq = ?";
|
||||
$query = $this->db->query($sql, [$vr_sq]);
|
||||
$rowModifyInfo = $query->getRowArray();
|
||||
|
||||
log_message('debug', $this->db->getLastQuery());
|
||||
|
||||
// 검증결과
|
||||
$sql = "SELECT vr_sq, vrfc_type, success, type, charger, date, insert_user, insert_tm, update_user, update_tm, work_type
|
||||
FROM v2_confirm WHERE vr_sq = ? AND vrfc_type = ?";
|
||||
$query = $this->db->query($sql, [$vr_sq, $rowVrfcReq['vrfc_type']]);
|
||||
$rowConfirm = $query->getRowArray();
|
||||
|
||||
log_message('debug', $this->db->getLastQuery());
|
||||
|
||||
// 확인정보
|
||||
$sql = "SELECT type, code, comment, ownerNm, ownerBirth FROM v2_check_list WHERE vr_sq = ? AND vrfc_type = ? AND type LIKE CONCAT(vrfc_type, '%')";
|
||||
$query = $this->db->query($sql, [$vr_sq, $rowVrfcReq['vrfc_type']]);
|
||||
$resCheckList = $query->getResultArray();
|
||||
|
||||
log_message('debug', $this->db->getLastQuery());
|
||||
|
||||
if (!empty($rowConfirm)) {
|
||||
log_message('debug', implode(', ', $rowConfirm));
|
||||
}
|
||||
|
||||
$atclNo = $rowVrfcReq['atcl_no'] ?? null;
|
||||
$success = !empty($rowConfirm['success']);
|
||||
$charger = $rowConfirm['charger'] ?? null;
|
||||
$date = $rowConfirm['date'] ?? null;
|
||||
$tryCnt = $rowVrfcReq['try_cnt'] ?? 0;
|
||||
|
||||
$checkList = [];
|
||||
foreach ($resCheckList as $row) {
|
||||
$checkList[] = [
|
||||
'type' => $row['type'],
|
||||
'code' => $row['code'],
|
||||
'comment' => $row['comment'],
|
||||
'ownerNm' => $row['ownerNm'],
|
||||
'ownerBirth' => $row['ownerBirth'],
|
||||
];
|
||||
}
|
||||
|
||||
$modifyInfo = [];
|
||||
if (($rowModifyInfo['modify_yn'] ?? 'N') === 'Y') {
|
||||
if (!empty($rowModifyInfo['hscp_no'])) {
|
||||
// 공동주택
|
||||
$modifyInfo = [
|
||||
'hscpNo' => $rowModifyInfo['hscp_no'],
|
||||
'ptpNo' => $rowModifyInfo['ptp_no'],
|
||||
'bildNm' => $rowModifyInfo['address2'],
|
||||
'rmNo' => $rowModifyInfo['address3'],
|
||||
'tradeType' => $rowModifyInfo['trade_type'],
|
||||
'dealAmt' => $rowModifyInfo['deal_amt'],
|
||||
'wrrntAmt' => $rowModifyInfo['wrrnt_amt'],
|
||||
'leaseAmt' => $rowModifyInfo['lease_amt'],
|
||||
'isaleAmt' => $rowModifyInfo['isale_amt'],
|
||||
'premAmt' => $rowModifyInfo['prem_amt'],
|
||||
'floor' => $rowModifyInfo['floor'],
|
||||
];
|
||||
} else {
|
||||
// 비공동주택
|
||||
$modifyInfo = [
|
||||
'addressCode' => $rowModifyInfo['address_code'],
|
||||
'address2' => $rowModifyInfo['address2'],
|
||||
'address3' => $rowModifyInfo['address3'],
|
||||
'tradeType' => $rowModifyInfo['trade_type'],
|
||||
'dealAmt' => $rowModifyInfo['deal_amt'],
|
||||
'wrrntAmt' => $rowModifyInfo['wrrnt_amt'],
|
||||
'leaseAmt' => $rowModifyInfo['lease_amt'],
|
||||
'splySpc' => $rowModifyInfo['sply_spc'],
|
||||
'exclsSpc' => $rowModifyInfo['excls_spc'],
|
||||
'totSpc' => $rowModifyInfo['tot_spc'],
|
||||
'grndSpc' => $rowModifyInfo['grnd_spc'],
|
||||
'bldgSpc' => $rowModifyInfo['bldg_spc'],
|
||||
'floor' => $rowModifyInfo['floor'],
|
||||
'floor2' => $rowModifyInfo['floor2'],
|
||||
];
|
||||
}
|
||||
|
||||
return [
|
||||
'atclNo' => $atclNo,
|
||||
'success' => $success,
|
||||
'checkList' => $checkList,
|
||||
'charger' => $charger,
|
||||
'modifyInfo' => $modifyInfo,
|
||||
'date' => $date,
|
||||
'try_cnt' => $tryCnt,
|
||||
];
|
||||
}
|
||||
|
||||
return [
|
||||
'atclNo' => $atclNo,
|
||||
'success' => $success,
|
||||
'checkList' => $checkList,
|
||||
'charger' => $charger,
|
||||
'date' => $date,
|
||||
'try_cnt' => $tryCnt,
|
||||
];
|
||||
}
|
||||
|
||||
/* 등기부등본 API 호출*/
|
||||
/**
|
||||
* $vrfc_type: 값이 R이면 등기부등본
|
||||
*/
|
||||
public function getDatacertAPI($vr_sq, $vrfc_type = '')
|
||||
{
|
||||
// 요청정보
|
||||
$sql = "SELECT vr_sq, atcl_no, step, cpid, cp_atcl_id, trade_type, realtor_nm, realtor_tel_no, seller_tel_no, vrfc_type, rgbk_confirm, req_type, rdate, stat_cd, try_cnt, insert_user, insert_tm, reg_try_cnt, owner_verifiable
|
||||
FROM v2_vrfc_req WHERE vr_sq = ?";
|
||||
$query = $this->db->query($sql, [$vr_sq]);
|
||||
$rowVrfcReq = $query->getRowArray();
|
||||
|
||||
if (!empty($vrfc_type)) {
|
||||
$rowVrfcReq['vrfc_type'] = $vrfc_type;
|
||||
}
|
||||
|
||||
log_message('debug', (string) $this->db->getLastQuery());
|
||||
|
||||
// 매물정보
|
||||
$sql = "SELECT vr_sq, atcl_no, cpid, cp_atcl_id, rlet_type_cd, trade_type, address_code, address1, address2, address3, sply_spc, excls_spc, tot_spc, grnd_spc, bldg_spc, deal_amt, wrrnt_amt, lease_amt, isale_amt, prem_amt, sise, floor, rdate, seller_tel_no, seller_nm, realtor_nm, realtor_tel_no, hscp_no, hscp_nm, ptp_no, ptp_nm, charger, req_price_yn, reg_charger, dept1_sq, dept2_sq, reg_dept1_sq, reg_dept2_sq, floor2
|
||||
FROM v2_article_info WHERE vr_sq = ?";
|
||||
$query = $this->db->query($sql, [$vr_sq]);
|
||||
$rowArticleInfo = $query->getRowArray();
|
||||
|
||||
log_message('debug', (string) $this->db->getLastQuery());
|
||||
|
||||
// 수정정보
|
||||
$sql = "SELECT vr_sq, bild_nm, rm_no, floor, address_code, address2, address3, trade_type, deal_amt, wrrnt_amt, lease_amt, isale_amt, prem_amt, sply_spc, excls_spc, tot_spc, grnd_spc, bldg_spc, hscp_no, hscp_nm, ptp_no, ptp_nm, modify_yn, floor2
|
||||
FROM v2_modify_info WHERE vr_sq = ?";
|
||||
$query = $this->db->query($sql, [$vr_sq]);
|
||||
$rowModifyInfo = $query->getRowArray();
|
||||
|
||||
log_message('debug', (string) $this->db->getLastQuery());
|
||||
|
||||
// 검증결과
|
||||
$sql = "SELECT vr_sq, vrfc_type, success, type, charger, date, insert_user, insert_tm, update_user, update_tm, work_type
|
||||
FROM v2_confirm WHERE vr_sq = ? AND vrfc_type = ?";
|
||||
$query = $this->db->query($sql, [$vr_sq, $rowVrfcReq['vrfc_type']]);
|
||||
$rowConfirm = $query->getRowArray();
|
||||
|
||||
log_message('debug', (string) $this->db->getLastQuery());
|
||||
|
||||
// 확인정보
|
||||
$sql = "SELECT a.type, a.code, a.comment, b.ownerNm, b.owner_birth
|
||||
FROM v2_check_list a
|
||||
INNER JOIN v2_article_info b ON a.vr_sq = b.vr_sq
|
||||
WHERE a.vr_sq = ? AND a.vrfc_type = ?";
|
||||
$query = $this->db->query($sql, [$vr_sq, $rowVrfcReq['vrfc_type']]);
|
||||
$resCheckList = $query->getResultArray();
|
||||
|
||||
log_message('debug', (string) $this->db->getLastQuery());
|
||||
|
||||
if (!empty($rowConfirm)) {
|
||||
log_message('debug', implode(', ', $rowConfirm));
|
||||
}
|
||||
|
||||
$atclNo = $rowVrfcReq['atcl_no'] ?? null;
|
||||
$type = $rowVrfcReq['try_cnt'] ?? null;
|
||||
$success = !empty($rowConfirm['success']);
|
||||
$charger = $rowConfirm['charger'] ?? null;
|
||||
$date = $rowConfirm['date'] ?? null;
|
||||
|
||||
switch ($rowVrfcReq['owner_verifiable'] ?? null) {
|
||||
case '1':
|
||||
case 'true':
|
||||
$ownerVerifiable = true;
|
||||
break;
|
||||
default:
|
||||
$ownerVerifiable = false;
|
||||
break;
|
||||
}
|
||||
|
||||
$checkList = [];
|
||||
foreach ($resCheckList as $row) {
|
||||
$checkList[] = [
|
||||
'type' => $row['type'],
|
||||
'code' => $row['code'],
|
||||
'comment' => $row['comment'],
|
||||
'ownerNm' => $row['ownerNm'],
|
||||
'ownerBirth' => $row['owner_birth'],
|
||||
];
|
||||
}
|
||||
|
||||
$modifyInfo = [];
|
||||
if (($rowModifyInfo['modify_yn'] ?? 'N') === 'Y') {
|
||||
if (!empty($rowModifyInfo['hscp_no'])) {
|
||||
$modifyInfo = [
|
||||
'hscpNo' => $rowModifyInfo['hscp_no'],
|
||||
'ptpNo' => $rowModifyInfo['ptp_no'],
|
||||
'bildNm' => $rowModifyInfo['address2'],
|
||||
'rmNo' => $rowModifyInfo['address3'],
|
||||
'tradeType' => $rowModifyInfo['trade_type'],
|
||||
'dealAmt' => $rowModifyInfo['deal_amt'],
|
||||
'wrrntAmt' => $rowModifyInfo['wrrnt_amt'],
|
||||
'leaseAmt' => $rowModifyInfo['lease_amt'],
|
||||
'isaleAmt' => $rowModifyInfo['isale_amt'],
|
||||
'premAmt' => $rowModifyInfo['prem_amt'],
|
||||
'floor' => $rowModifyInfo['floor'],
|
||||
];
|
||||
} else {
|
||||
$modifyInfo = [
|
||||
'addressCode' => $rowModifyInfo['address_code'],
|
||||
'address2' => $rowModifyInfo['address2'],
|
||||
'address3' => $rowModifyInfo['address3'],
|
||||
'tradeType' => $rowModifyInfo['trade_type'],
|
||||
'dealAmt' => $rowModifyInfo['deal_amt'],
|
||||
'wrrntAmt' => $rowModifyInfo['wrrnt_amt'],
|
||||
'leaseAmt' => $rowModifyInfo['lease_amt'],
|
||||
'splySpc' => $rowModifyInfo['sply_spc'],
|
||||
'exclsSpc' => $rowModifyInfo['excls_spc'],
|
||||
'totSpc' => $rowModifyInfo['tot_spc'],
|
||||
'grndSpc' => $rowModifyInfo['grnd_spc'],
|
||||
'bldgSpc' => $rowModifyInfo['bldg_spc'],
|
||||
'floor' => $rowModifyInfo['floor'],
|
||||
'floor2' => $rowModifyInfo['floor2'],
|
||||
];
|
||||
}
|
||||
|
||||
return [
|
||||
'atclNo' => $atclNo,
|
||||
'type' => $type,
|
||||
'success' => $success,
|
||||
'checkList' => $checkList,
|
||||
'charger' => $charger,
|
||||
'modifyInfo' => $modifyInfo,
|
||||
'date' => $date,
|
||||
'ownerVerifiable' => $ownerVerifiable,
|
||||
];
|
||||
}
|
||||
|
||||
return [
|
||||
'atclNo' => $atclNo,
|
||||
'type' => $type,
|
||||
'success' => $success,
|
||||
'checkList' => $checkList,
|
||||
'charger' => $charger,
|
||||
'date' => $date,
|
||||
'ownerVerifiable' => $ownerVerifiable,
|
||||
];
|
||||
}
|
||||
|
||||
public function InsCharger($atcl_vr_sq)
|
||||
{
|
||||
$usr_id = session('usr_id');
|
||||
|
||||
$sql = "UPDATE v2_article_info" .
|
||||
" SET charger = ?" .
|
||||
" WHERE vr_sq = ?";
|
||||
|
||||
$data = array(
|
||||
$usr_id,
|
||||
$atcl_vr_sq
|
||||
);
|
||||
|
||||
$this->db->query($sql, $data);
|
||||
}
|
||||
|
||||
public function getUpdateFailTime1($vr_sq)
|
||||
{
|
||||
$sql = "select vr_sq, stat_cd, insert_user, insert_tm " .
|
||||
"from v2_chg_stat " .
|
||||
"where vr_sq = ? and stat_cd = '39' " .
|
||||
"order by insert_tm desc " .
|
||||
"limit 1";
|
||||
$data = array($vr_sq);
|
||||
$query = $this->db->query($sql, $data);
|
||||
$row = $query->getRowArray();
|
||||
|
||||
return $row;
|
||||
|
||||
}
|
||||
|
||||
public function getUpdateFailTime2($vr_sq)
|
||||
{
|
||||
$sql = "select vr_sq, stat_cd, insert_user, insert_tm " .
|
||||
"from v2_chg_stat " .
|
||||
"where vr_sq = ? and stat_cd = '49' " .
|
||||
"order by insert_tm desc " .
|
||||
"limit 1";
|
||||
$data = array($vr_sq);
|
||||
$query = $this->db->query($sql, $data);
|
||||
$row = $query->getRowArray();
|
||||
|
||||
return $row;
|
||||
}
|
||||
|
||||
public function deleteChkList($vr_sq, $vrfc_type, $type)
|
||||
{
|
||||
$sql = "delete from v2_check_list where vr_sq = ? and vrfc_type = ? and type = ?";
|
||||
$data = array(
|
||||
$vr_sq,
|
||||
$vrfc_type,
|
||||
$type
|
||||
);
|
||||
$this->db->query($sql, $data);
|
||||
}
|
||||
|
||||
public function up_tel_fail_cause($vr_sq, $tel_fail_cause)
|
||||
{
|
||||
$sql = "UPDATE v2_vrfc_req" .
|
||||
" SET tel_fail_cause = ? " .
|
||||
" WHERE vr_sq = ?";
|
||||
|
||||
$data = array(
|
||||
$tel_fail_cause,
|
||||
$vr_sq
|
||||
);
|
||||
|
||||
$this->db->query($sql, $data);
|
||||
}
|
||||
|
||||
// 변경이력 저장
|
||||
public function saveHistory($vr_sq, $stat_cd, $chg_type, $usr_id, $memo)
|
||||
|
||||
@@ -704,4 +704,19 @@ class M710Model extends Model
|
||||
}
|
||||
|
||||
|
||||
public function get_send_yn($type)
|
||||
{
|
||||
$sql = "SELECT stop_yn
|
||||
FROM v2_stop_api_chg_stat
|
||||
WHERE TYPE = ?
|
||||
ORDER BY pk DESC
|
||||
LIMIT 1";
|
||||
$date = array(
|
||||
$type
|
||||
);
|
||||
$query = $this->db->query($sql, $date);
|
||||
$return = $query->getRowArray();
|
||||
|
||||
return $return;
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user