홍보확인서 추가
This commit is contained in:
@@ -155,4 +155,187 @@ class M415Model extends Model
|
||||
|
||||
return $query->getResultArray();
|
||||
}
|
||||
|
||||
|
||||
// 팩스 인입시간
|
||||
public function getFaxSaveTime($vr_sq)
|
||||
{
|
||||
$sql = "SELECT recv_time from fax_imgs" .
|
||||
" WHERE vr_sq = ?" .
|
||||
" ORDER BY fax_sq DESC" .
|
||||
" LIMIT 1";
|
||||
$data = [
|
||||
$vr_sq
|
||||
];
|
||||
$query = $this->db->query($sql, $data);
|
||||
|
||||
$res = $query->getRowArray();
|
||||
return $res;
|
||||
}
|
||||
|
||||
// 서류/전화 불일치 시간
|
||||
public function getFaxFailTimeForHistory($vr_sq)
|
||||
{
|
||||
$sql = "select insert_tm from v2_chg_history" .
|
||||
" where vr_sq = ?" .
|
||||
" and stat_cd = '39'" .
|
||||
" and chg_type= 'C9'" .
|
||||
" order by seq desc" .
|
||||
" limit 1";
|
||||
$data = [
|
||||
$vr_sq
|
||||
];
|
||||
$query = $this->db->query($sql, $data);
|
||||
// echo $this->db->last_query().'<br>';
|
||||
$res = $query->row_array();
|
||||
return $res;
|
||||
}
|
||||
|
||||
// 등기부등본 확인중 시간, 서류에서 등기로 넘어갈때 간혹 서류전화 확인 완료가 안찍히는 건들이 있다
|
||||
public function get_cert_ing_TimeForHistory($vr_sq)
|
||||
{
|
||||
$sql = "select insert_tm from v2_chg_history" .
|
||||
" where vr_sq = ?" .
|
||||
" and stat_cd = '40'" .
|
||||
" and chg_type= 'C9'" .
|
||||
" order by seq desc" .
|
||||
" limit 1";
|
||||
$data = array(
|
||||
$vr_sq
|
||||
);
|
||||
$query = $this->db->query($sql, $data);
|
||||
// echo $this->db->last_query().'<br>';
|
||||
$res = $query->row_array();
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
//서류전화 (검증실패/검증완료)
|
||||
public function insert_v2_time_required_Conf_Done($atcl_no, $cpid, $vrfc_type, $insert_tm, $tel_doc_conf_dt, $finishTime)
|
||||
{
|
||||
if (substr($insert_tm, 0, 10) == substr($tel_doc_conf_dt, 0, 10)) {
|
||||
switch ($vrfc_type) {
|
||||
case 'D':
|
||||
if (('12:00:00' < substr($insert_tm, -8)) && (substr($insert_tm, -8) < '13:00:00')) {//접수시간이 12~13시 사이면 13시로 해준다
|
||||
if (substr($tel_doc_conf_dt, -8) > '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($tel_doc_conf_dt, -8) < '17:30:00' || substr($tel_doc_conf_dt, -8) < '08:59:59')
|
||||
) {
|
||||
$insert_tm = date("Y-m-d", time()) . " 09:00:00";
|
||||
}
|
||||
;
|
||||
break;
|
||||
|
||||
case 'T':
|
||||
if (('13:00:00' < substr($insert_tm, -8)) && (substr($insert_tm, -8) < '14:00:00')) {//접수시간이 13~14시 사이면 14시로 해준다
|
||||
if (substr($tel_doc_conf_dt, -8) > '14:00:00') { //검증완료가 14시 '이후'에 끝나면 접수시간을 14시로 변경해준다
|
||||
$insert_tm = date("Y-m-d", time()) . " 14:00:00";
|
||||
}
|
||||
} else if (
|
||||
(substr($insert_tm, -8) > '17:30:00' || substr($insert_tm, -8) < '08:59:59') &&
|
||||
(substr($tel_doc_conf_dt, -8) < '17:30:00' || substr($tel_doc_conf_dt, -8) < '08:59:59')
|
||||
) { //접수와 확인완료시간이 모두 17:30:00 ~ 09:00:00 사이면
|
||||
$insert_tm = date("Y-m-d", time()) . " 09:30:00";
|
||||
}
|
||||
;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
if ($vrfc_type == 'D') { //홍보
|
||||
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";
|
||||
}
|
||||
} else { //전화
|
||||
if (substr($insert_tm, -8) > '17:30:00' || substr($insert_tm, -8) < '08:59:59') {
|
||||
$insert_tm = date("Y-m-d", time()) . " 09:30:00";
|
||||
}
|
||||
}
|
||||
}
|
||||
$stan_date = substr($insert_tm, 0, 10);
|
||||
|
||||
$sql = "INSERT INTO v2_time_required(stan_date, atcl_no, cpid, vrfc_type, insert_tm, tel_doc_conf_dt,conf_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 = [
|
||||
$stan_date,
|
||||
$atcl_no,
|
||||
$cpid,
|
||||
$vrfc_type,
|
||||
$insert_tm,
|
||||
$tel_doc_conf_dt,
|
||||
$tel_doc_conf_dt,
|
||||
$insert_tm,
|
||||
$tel_doc_conf_dt,
|
||||
$insert_tm
|
||||
];
|
||||
$this->db->query($sql, $data);
|
||||
}
|
||||
|
||||
//서류전화 확인완료(일치/불일치)
|
||||
//서류전화 (검증실패/검증완료)
|
||||
public function insert_v2_time_required_Conf($atcl_no, $cpid, $vrfc_type, $insert_tm, $tel_doc_conf_dt, $finishTime)
|
||||
{
|
||||
if (substr($insert_tm, 0, 10) == substr($tel_doc_conf_dt, 0, 10)) {
|
||||
switch ($vrfc_type) {
|
||||
case 'D':
|
||||
if (('12:00:00' < substr($insert_tm, -8)) && (substr($insert_tm, -8) < '13:00:00')) {//접수시간이 12~13시 사이면 13시로 해준다
|
||||
if (substr($tel_doc_conf_dt, -8) > '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($tel_doc_conf_dt, -8) < '17:30:00' || substr($tel_doc_conf_dt, -8) < '08:59:59')
|
||||
) {
|
||||
$insert_tm = date("Y-m-d", time()) . " 09:00:00";
|
||||
}
|
||||
;
|
||||
break;
|
||||
|
||||
case 'T':
|
||||
if (('13:00:00' < substr($insert_tm, -8)) && (substr($insert_tm, -8) < '14:00:00')) {//접수시간이 13~14시 사이면 14시로 해준다
|
||||
if (substr($tel_doc_conf_dt, -8) > '14:00:00') { //검증완료가 14시 '이후'에 끝나면 접수시간을 14시로 변경해준다
|
||||
$insert_tm = date("Y-m-d", time()) . " 14:00:00";
|
||||
}
|
||||
} else if (
|
||||
(substr($insert_tm, -8) > '17:30:00' || substr($insert_tm, -8) < '08:59:59') &&
|
||||
(substr($tel_doc_conf_dt, -8) < '17:30:00' || substr($tel_doc_conf_dt, -8) < '08:59:59')
|
||||
) { //접수와 확인완료시간이 모두 17:30:00 ~ 09:00:00 사이면
|
||||
$insert_tm = date("Y-m-d", time()) . " 09:30:00";
|
||||
}
|
||||
;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
if ($vrfc_type == 'D') { //홍보
|
||||
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";
|
||||
}
|
||||
} else { //전화
|
||||
if (substr($insert_tm, -8) > '17:30:00' || substr($insert_tm, -8) < '08:59:59') {
|
||||
$insert_tm = date("Y-m-d", time()) . " 09:30:00";
|
||||
}
|
||||
}
|
||||
}
|
||||
$stan_date = substr($insert_tm, 0, 10);
|
||||
|
||||
$sql = "INSERT INTO v2_time_required(stan_date, atcl_no, cpid, vrfc_type, insert_tm, tel_doc_conf_dt,conf_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,
|
||||
$tel_doc_conf_dt,
|
||||
$tel_doc_conf_dt,
|
||||
$insert_tm,
|
||||
$tel_doc_conf_dt,
|
||||
$insert_tm
|
||||
);
|
||||
$this->db->query($sql, $data);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user