This commit is contained in:
@@ -135,7 +135,7 @@ class DeptModel extends Model
|
||||
$builder->where('a.rcpt_atclno', $data['rcpt_atclno']);
|
||||
} else {
|
||||
|
||||
$builder->where('a.isSiteVRVerification', 'N');
|
||||
// $builder->where('a.isSiteVRVerification', 'N');
|
||||
|
||||
// 접수일자
|
||||
/*
|
||||
@@ -228,10 +228,7 @@ class DeptModel extends Model
|
||||
$builder->groupStart()
|
||||
->like('a.agent_nm', $data['srchTxt'])
|
||||
->orLike('a.sellr_nm', $data['srchTxt'])
|
||||
->groupEnd();
|
||||
|
||||
$builder->groupStart()
|
||||
->like('a.agent_head_tel', $data['srchTxt'])
|
||||
->orLike('a.agent_head_tel', $data['srchTxt'])
|
||||
->orLike('a.sellr_tel_no', $data['srchTxt'])
|
||||
->groupEnd();
|
||||
}
|
||||
@@ -277,7 +274,7 @@ class DeptModel extends Model
|
||||
$builder->where('a.rcpt_atclno', $data['rcpt_atclno']);
|
||||
} else {
|
||||
|
||||
$builder->where('a.isSiteVRVerification', 'N');
|
||||
// $builder->where('a.isSiteVRVerification', 'N');
|
||||
|
||||
// 접수일자
|
||||
/*
|
||||
@@ -418,7 +415,7 @@ class DeptModel extends Model
|
||||
$builder->where('a.rcpt_atclno', $data['rcpt_atclno']);
|
||||
} else {
|
||||
|
||||
$builder->where('b.req_rec_yn', 'Y');
|
||||
// $builder->where('b.req_rec_yn', 'Y');
|
||||
|
||||
// 접수일자
|
||||
/*
|
||||
@@ -662,7 +659,7 @@ class DeptModel extends Model
|
||||
$builder->where('a.rcpt_atclno', $data['rcpt_atclno']);
|
||||
} else {
|
||||
|
||||
$builder->where('b.req_rec_yn', 'Y');
|
||||
// $builder->where('b.req_rec_yn', 'Y');
|
||||
|
||||
// 접수일자
|
||||
/*
|
||||
@@ -769,10 +766,7 @@ class DeptModel extends Model
|
||||
$builder->groupStart()
|
||||
->like('a.agent_nm', $data['srchTxt'])
|
||||
->orLike('a.sellr_nm', $data['srchTxt'])
|
||||
->groupEnd();
|
||||
|
||||
$builder->groupStart()
|
||||
->like('a.agent_head_tel', $data['srchTxt'])
|
||||
->orLike('a.agent_head_tel', $data['srchTxt'])
|
||||
->orLike('a.sellr_tel_no', $data['srchTxt'])
|
||||
->groupEnd();
|
||||
}
|
||||
@@ -845,97 +839,32 @@ class DeptModel extends Model
|
||||
|
||||
$builder = $this->db->table('receipt a');
|
||||
|
||||
$builder->select("a.rcpt_sq
|
||||
,a.comp_sq
|
||||
,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_product_info1
|
||||
,a.rcpt_product_info2
|
||||
,a.rcpt_product_info3
|
||||
,a.rcpt_product_info4
|
||||
,a.rcpt_product_info5
|
||||
,a.rcpt_ptp_nm
|
||||
,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
|
||||
,IFNULL(a.rcpt_hscp_nm, '') AS rcpt_hscp_nm
|
||||
,IFNULL(a.rcpt_ho, '') AS rcpt_ho
|
||||
,a.rcpt_dtl_addr
|
||||
,a.rcpt_li_addr
|
||||
,a.rcpt_jibun_addr
|
||||
,IFNULL(a.rcpt_etc_addr, '') AS rcpt_etc_addr
|
||||
,a.rcpt_floor
|
||||
,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
|
||||
,a.agent_id
|
||||
,a.agent_nm
|
||||
,a.agent_head
|
||||
,a.agent_head_tel
|
||||
,a.agent_contact
|
||||
,a.agent_contact_tel
|
||||
,IFNULL(a.agent_tel, '') AS agent_tel
|
||||
,a.sply_spc
|
||||
,a.excls_spc
|
||||
,a.room_cnt
|
||||
,a.exp_spc_yn
|
||||
,a.agent_fax
|
||||
,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
|
||||
,f.cd_nm as trade_type_nm
|
||||
,b.rsrv_sq
|
||||
,b.dept_sq
|
||||
,b.usr_sq
|
||||
,b.rsrv_tm_hour
|
||||
,b.result_cd1
|
||||
,b.result_cd2
|
||||
,b.result_msg
|
||||
,b.request_msg
|
||||
,b.photo_save_dt
|
||||
,b.rsrv_delay_dt
|
||||
,b.rsrv_cplt_dt
|
||||
,b.check_dt
|
||||
,b.check_cplt_dt
|
||||
,b.record_cplt_dt
|
||||
,get_code_name('RECEIPT_STATUS1', substring(a.rcpt_stat, 1, 2)) AS rcpt_stat_nm
|
||||
,c.region_nm as addr
|
||||
,b.result_save_dt
|
||||
,u.usr_nm
|
||||
,d.dept_nm
|
||||
,a.exp_photo_yn
|
||||
,a.ground_plan
|
||||
,CASE (SELECT COUNT(1) FROM result_imgs WHERE rsrv_sq=b.rsrv_sq AND img_type = 'I1' AND use_yn = 'Y') WHEN 0 THEN 'N' ELSE 'Y' END conf_img_yn
|
||||
,CASE (SELECT COUNT(1) FROM result_imgs WHERE rsrv_sq=b.rsrv_sq AND img_type = 'I5' AND use_yn = 'Y') WHEN 0 THEN 'N' ELSE 'Y' END ground_plan_yn
|
||||
,a.exp_movie_yn
|
||||
,a.direct_trad_yn
|
||||
,a.sellr_nm
|
||||
,a.sellr_tel_no
|
||||
,a.isSiteVRVerification
|
||||
,a.isPromotionApply");
|
||||
$builder->select("
|
||||
CASE WHEN b.result_cd1 = '90' THEN get_code_name('RECEIPT_STATUS2', b.result_cd2) ELSE '' END AS '매물ID',
|
||||
a.rcpt_atclno AS '예약일자',
|
||||
b.rsrv_tm_hour AS '중개사명',
|
||||
b.photo_save_dt AS '대표전화',
|
||||
a.agent_contact_tel AS '담당자전화',
|
||||
CASE
|
||||
WHEN IFNULL(a.rcpt_jibun_addr, '') = '' THEN
|
||||
CASE
|
||||
WHEN IFNULL(a.rcpt_hscp_nm, '') = '' THEN
|
||||
CONCAT(c.region_nm, ' ', a.rcpt_dtl_addr, ' ', a.rcpt_ho)
|
||||
ELSE
|
||||
CONCAT(c.region_nm, ' ', a.rcpt_hscp_nm, ' ', a.rcpt_dtl_addr, ' ', a.rcpt_ho)
|
||||
END
|
||||
ELSE
|
||||
CASE
|
||||
WHEN IFNULL(a.rcpt_li_addr, '') != '' THEN
|
||||
CONCAT(c.region_nm, ' ', a.rcpt_li_addr, ' ', a.rcpt_jibun_addr, ' ', a.rcpt_etc_addr)
|
||||
ELSE
|
||||
CONCAT(c.region_nm, ' ', a.rcpt_jibun_addr, ' ', a.rcpt_etc_addr)
|
||||
END
|
||||
END AS '주소',
|
||||
a.rcpt_product_nm AS '매물종류',
|
||||
a.rcpt_product_info1 AS '거래구분',
|
||||
u.usr_nm AS '담당자',
|
||||
b.request_msg AS '중개사 요청사항'");
|
||||
|
||||
$builder->join('result b', 'a.rcpt_sq = b.rcpt_sq', 'left');
|
||||
$builder->join('region_codes c', 'a.rcpt_dong = c.region_cd', 'inner');
|
||||
@@ -958,7 +887,7 @@ class DeptModel extends Model
|
||||
$builder->where('a.rcpt_atclno', $data['rcpt_atclno']);
|
||||
} else {
|
||||
|
||||
$builder->where('b.req_rec_yn', 'Y');
|
||||
// $builder->where('b.req_rec_yn', 'Y');
|
||||
|
||||
// 접수일자
|
||||
/*
|
||||
@@ -1065,10 +994,7 @@ class DeptModel extends Model
|
||||
$builder->groupStart()
|
||||
->like('a.agent_nm', $data['srchTxt'])
|
||||
->orLike('a.sellr_nm', $data['srchTxt'])
|
||||
->groupEnd();
|
||||
|
||||
$builder->groupStart()
|
||||
->like('a.agent_head_tel', $data['srchTxt'])
|
||||
->orLike('a.agent_head_tel', $data['srchTxt'])
|
||||
->orLike('a.sellr_tel_no', $data['srchTxt'])
|
||||
->groupEnd();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user