This commit is contained in:
@@ -61,6 +61,7 @@ $routes->group('', ['namespace' => 'App\Controllers\Article'], static function (
|
|||||||
*/
|
*/
|
||||||
$routes->group('article', static function ($routes) {
|
$routes->group('article', static function ($routes) {
|
||||||
$routes->get('receipt/lists', 'Receipt::lists');
|
$routes->get('receipt/lists', 'Receipt::lists');
|
||||||
|
$routes->get('receipt/detail/(:num)', 'Receipt::detail/$1');
|
||||||
|
|
||||||
$routes->get('receipt/getResultList', 'Receipt::getResultList');
|
$routes->get('receipt/getResultList', 'Receipt::getResultList');
|
||||||
|
|
||||||
|
|||||||
@@ -135,4 +135,42 @@ class Receipt extends BaseController
|
|||||||
$e->getPrevious()->getTraceAsString();
|
$e->getPrevious()->getTraceAsString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 상세화면
|
||||||
|
public function detail($id)
|
||||||
|
{
|
||||||
|
$id = (int) $id;
|
||||||
|
|
||||||
|
if ($id <= 0) {
|
||||||
|
throw \CodeIgniter\Exceptions\PageNotFoundException::forPageNotFound();
|
||||||
|
}
|
||||||
|
|
||||||
|
$codes = $this->codeModel->getCodeLists(['TRADE_TYPE', 'RECEIPT_STATUS2', 'RECEIPT_STATUS3', 'SMS_MSG_TYPE']); // 코드조회
|
||||||
|
$bonbu = $this->model->getBonbuList();
|
||||||
|
$team = $this->model->getTeamList();
|
||||||
|
|
||||||
|
$data = $this->model->getDetail($id);
|
||||||
|
$history = $this->model->getHistory($id);
|
||||||
|
|
||||||
|
$aptGround = $this->model->getAptGround($data['rcpt_dong']);
|
||||||
|
|
||||||
|
|
||||||
|
// 시간대별통계
|
||||||
|
$tmCount = $this->model->getUsrRsrvDateTmCount($id);
|
||||||
|
|
||||||
|
$this->data['codes'] = $codes;
|
||||||
|
$this->data['bonbu'] = $bonbu;
|
||||||
|
$this->data['team'] = $team;
|
||||||
|
|
||||||
|
$this->data['data'] = $data;
|
||||||
|
$this->data['history'] = $history;
|
||||||
|
|
||||||
|
$this->data['apt_ground'] = $aptGround;
|
||||||
|
|
||||||
|
$this->data['tmCount'] = $tmCount;
|
||||||
|
|
||||||
|
|
||||||
|
return view("pages/article/receipt/detail", $this->data);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -971,4 +971,253 @@ class ReceiptModel extends Model
|
|||||||
|
|
||||||
return $builder->get()->getResultArray();
|
return $builder->get()->getResultArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 상세
|
||||||
|
public function getDetail($id)
|
||||||
|
{
|
||||||
|
|
||||||
|
$builder = $this->db->table('receipt a');
|
||||||
|
|
||||||
|
$builder->select("
|
||||||
|
a.rcpt_sq
|
||||||
|
,a.comp_sq
|
||||||
|
,a.excls_spc
|
||||||
|
,a.rcpt_rating
|
||||||
|
,a.rcpt_key
|
||||||
|
,a.rcpt_atclno
|
||||||
|
,a.rcpt_type
|
||||||
|
,a.rcpt_product
|
||||||
|
,a.rcpt_product_nm
|
||||||
|
,a.rcpt_product_area
|
||||||
|
,a.rcpt_product_price
|
||||||
|
, a.rcpt_deal_type
|
||||||
|
,a.rcpt_product_info1
|
||||||
|
,a.rcpt_product_info2
|
||||||
|
,a.rcpt_product_info3
|
||||||
|
,a.rcpt_product_info4
|
||||||
|
,a.rcpt_product_info5
|
||||||
|
,a.rcpt_office
|
||||||
|
,(CASE WHEN a.rcpt_agent IS NULL THEN 'N' ELSE 'Y' END) as rcpt_agent
|
||||||
|
,a.rcpt_sido
|
||||||
|
,a.rcpt_gugun
|
||||||
|
,a.rcpt_dong
|
||||||
|
,a.rcpt_dtl_addr
|
||||||
|
,a.rcpt_li_addr
|
||||||
|
,a.rcpt_jibun_addr
|
||||||
|
,a.rcpt_etc_addr
|
||||||
|
,a.rcpt_ref_addr
|
||||||
|
,a.rcpt_ho
|
||||||
|
,a.rcpt_hscp_nm
|
||||||
|
,a.rcpt_floor
|
||||||
|
,a.rcpt_floor2
|
||||||
|
,a.chg_floor_yn
|
||||||
|
,a.rcpt_tm
|
||||||
|
,a.rcpt_stat
|
||||||
|
,a.rcpt_x
|
||||||
|
,a.rcpt_y
|
||||||
|
,a.rcpt_living_yn
|
||||||
|
,a.cust_nm
|
||||||
|
,a.cust_tel1
|
||||||
|
,a.cust_tel2
|
||||||
|
,a.cust_zip
|
||||||
|
,a.cust_addr1
|
||||||
|
,a.cust_addr2
|
||||||
|
,a.remark rcpt_remark
|
||||||
|
, a.rcpt_cpid
|
||||||
|
,a.agent_id
|
||||||
|
,a.agent_nm
|
||||||
|
,a.agent_head
|
||||||
|
,a.agent_head_tel
|
||||||
|
,a.agent_contact
|
||||||
|
,a.agent_contact_tel
|
||||||
|
,a.agent_fax
|
||||||
|
,a.agent_tel
|
||||||
|
,a.excls_spc
|
||||||
|
,a.excls_spc1
|
||||||
|
,a.excls_spc2
|
||||||
|
,a.sply_spc
|
||||||
|
,a.share_spc
|
||||||
|
,a.share_spc1
|
||||||
|
,a.share_spc2
|
||||||
|
,a.share_spc3
|
||||||
|
,a.share_spc4
|
||||||
|
,a.share_spc5
|
||||||
|
,a.room_cnt
|
||||||
|
,a.tot_spc
|
||||||
|
,a.tot_spc1
|
||||||
|
,a.tot_spc2
|
||||||
|
,a.grnd_spc
|
||||||
|
,a.grnd_spc1
|
||||||
|
,a.grnd_spc2
|
||||||
|
,a.grnd_spc3
|
||||||
|
,a.grnd_spc4
|
||||||
|
,a.grnd_spc5
|
||||||
|
,a.spc_stat
|
||||||
|
,a.exp_spc_yn
|
||||||
|
,DATE_FORMAT(COALESCE(b.rsrv_date, a.rsrv_date), '%Y-%m-%d') AS rsrv_date
|
||||||
|
,COALESCE(b.rsrv_tm_ap, a.rsrv_tm_ap) as rsrv_tm_ap
|
||||||
|
,a.insert_usr
|
||||||
|
,a.insert_tm
|
||||||
|
,a.update_usr
|
||||||
|
,a.update_tm
|
||||||
|
,a.svc_type1
|
||||||
|
,a.svc_type2
|
||||||
|
,a.reconf_yn
|
||||||
|
,a.cupnNo
|
||||||
|
,b.rsrv_sq
|
||||||
|
,b.dept_sq
|
||||||
|
,b.usr_sq
|
||||||
|
,b.req_rec_yn
|
||||||
|
,b.rec_yn
|
||||||
|
,b.rec_tel
|
||||||
|
,b.rec_nm
|
||||||
|
,b.remark
|
||||||
|
,b.rsrv_tm_hour
|
||||||
|
,b.result_cd1
|
||||||
|
,get_code_name('RECEIPT_STATUS1', b.result_cd1) AS result_cd1_nm
|
||||||
|
,b.result_cd2
|
||||||
|
,get_code_name('RECEIPT_STATUS2', b.result_cd2) AS result_cd2_nm
|
||||||
|
,b.result_cd3
|
||||||
|
,get_code_name('RECEIPT_STATUS3', b.result_cd3) AS result_cd3_nm
|
||||||
|
,b.result_msg
|
||||||
|
,b.rsrv_save_dt
|
||||||
|
,b.photo_save_dt
|
||||||
|
,DATE_FORMAT(b.photo_save_dt, '%Y-%m-%d') as photo_save_dt_dt
|
||||||
|
,DATE_FORMAT(b.photo_save_dt, '%H:%i:%s') as photo_save_dt_tm
|
||||||
|
,b.assign_save_dt
|
||||||
|
,b.result_save_dt
|
||||||
|
,b.request_msg
|
||||||
|
,b.rsrv_delay_dt
|
||||||
|
,DATE_FORMAT(b.rsrv_delay_dt, '%Y-%m-%d') as rsrv_delay_dt_dt
|
||||||
|
,DATE_FORMAT(b.rsrv_delay_dt, '%H:%i:%s') as rsrv_delay_dt_tm
|
||||||
|
,b.rsrv_cplt_dt
|
||||||
|
,DATE_FORMAT(b.rsrv_cplt_dt, '%Y-%m-%d') as rsrv_cplt_dt_dt
|
||||||
|
,DATE_FORMAT(b.rsrv_cplt_dt, '%H:%i:%s') as rsrv_cplt_dt_tm
|
||||||
|
,b.check_dt
|
||||||
|
,DATE_FORMAT(b.check_dt, '%Y-%m-%d') as check_dt_dt
|
||||||
|
,DATE_FORMAT(b.check_dt, '%H:%i:%s') as check_dt_tm
|
||||||
|
,b.check_cplt_dt
|
||||||
|
,DATE_FORMAT(b.check_cplt_dt, '%Y-%m-%d') as check_cplt_dt_dt
|
||||||
|
,DATE_FORMAT(b.check_cplt_dt, '%H:%i:%s') as check_cplt_dt_tm
|
||||||
|
,b.cancel_dt
|
||||||
|
,DATE_FORMAT(b.cancel_dt, '%Y-%m-%d') as cancel_dt_dt
|
||||||
|
,DATE_FORMAT(b.cancel_dt, '%H:%i:%s') as cancel_dt_tm
|
||||||
|
,b.check_delay_dt
|
||||||
|
,DATE_FORMAT(b.check_delay_dt, '%Y-%m-%d') as check_delay_dt_dt
|
||||||
|
,DATE_FORMAT(b.check_delay_dt, '%H:%i:%s') as check_delay_dt_tm
|
||||||
|
,b.check_fail_dt
|
||||||
|
,DATE_FORMAT(b.check_fail_dt, '%Y-%m-%d') as check_fail_dt_dt
|
||||||
|
,DATE_FORMAT(b.check_fail_dt, '%H:%i:%s') as check_fail_dt_tm
|
||||||
|
,get_code_name('RECEIPT_STATUS3', a.rcpt_stat) AS rcpt_stat_nm
|
||||||
|
,DATE_FORMAT(a.insert_tm, '%Y년 %m월 %d일') as insert_tm2
|
||||||
|
,DATE_FORMAT(a.rsrv_date, '%Y-%m-%d') as rsrv_date2
|
||||||
|
,c.region_nm as addr
|
||||||
|
,c.dept_sq as region_dept_sq
|
||||||
|
,c.usr_sq as region_usr_sq
|
||||||
|
,d.pdept_sq
|
||||||
|
,d.dept_nm
|
||||||
|
,a.rcpt_exps_type
|
||||||
|
,a.exp_photo_yn
|
||||||
|
,a.exp_movie_yn
|
||||||
|
,b.resYn
|
||||||
|
,DATE_ADD(a.insert_tm, INTERVAL +3 MONTH) as months
|
||||||
|
,b.dbUsageAgrYn
|
||||||
|
,a.trade_type
|
||||||
|
, a.rcpt_hscp_no
|
||||||
|
, a.rcpt_ptp_nm
|
||||||
|
, a.rcpt_ptp_no
|
||||||
|
, a.modify_yn
|
||||||
|
, a.ground_plan
|
||||||
|
,a.direct_trad_yn
|
||||||
|
,a.sellr_nm
|
||||||
|
,a.sellr_tel_no
|
||||||
|
,a.virAddr_yn
|
||||||
|
,a.isSiteVRVerification
|
||||||
|
,a.isPromotionApply
|
||||||
|
,DATE_FORMAT(b.vr_check_cplt_dt, '%Y-%m-%d') as vr_check_cplt_dt_dt
|
||||||
|
,DATE_FORMAT(b.vr_check_cplt_dt, '%H:%i:%s') as vr_check_cplt_dt_dm
|
||||||
|
", false);
|
||||||
|
|
||||||
|
$builder->join('result b', 'b.rcpt_sq = a.rcpt_sq', 'inner');
|
||||||
|
$builder->join('region_codes c', 'a.rcpt_dong = c.region_cd', 'inner');
|
||||||
|
$builder->join('departments d', 'b.dept_sq = d.dept_sq', 'left');
|
||||||
|
|
||||||
|
|
||||||
|
$builder->where('a.rcpt_key', $id);
|
||||||
|
|
||||||
|
|
||||||
|
return $builder->get()->getRowArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 정보변경이력
|
||||||
|
public function getHistory($id)
|
||||||
|
{
|
||||||
|
$sql = "SELECT seq" .
|
||||||
|
" ,rcpt_sq" .
|
||||||
|
" ,rcpt_stat" .
|
||||||
|
" ,get_code_name('RECEIPT_STATUS3', rcpt_stat) AS rcpt_stat_nm" .
|
||||||
|
" ,rcpt_stat" .
|
||||||
|
" ,get_code_name('CHANGED_TYPE', changed_type) AS changed_type_nm" .
|
||||||
|
" ,changed_type" .
|
||||||
|
" ,changed_id" .
|
||||||
|
" ,remark" .
|
||||||
|
" ,DATE_FORMAT(changed_tm, '%Y.%m.%d %H:%i:%s') as changed_tm" .
|
||||||
|
" FROM changed_history" .
|
||||||
|
" WHERE rcpt_sq = ?" .
|
||||||
|
" ORDER BY changed_tm DESC";
|
||||||
|
|
||||||
|
$data = [$id];
|
||||||
|
$query = $this->db->query($sql, $data);
|
||||||
|
|
||||||
|
return $query->getResultArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getAptGround($rcpt_dong)
|
||||||
|
{
|
||||||
|
|
||||||
|
$sql = "SELECT ";
|
||||||
|
$sql .= "* ";
|
||||||
|
$sql .= "FROM apt_ground ";
|
||||||
|
$sql .= "WHERE region_cd = ? ";
|
||||||
|
|
||||||
|
$data = [$rcpt_dong];
|
||||||
|
|
||||||
|
$query = $this->db->query($sql, $data);
|
||||||
|
|
||||||
|
return $query->getResultArray();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// 시간대별통계
|
||||||
|
public function getUsrRsrvDateTmCount($id)
|
||||||
|
{
|
||||||
|
$sql = "SELECT b.usr_sq, b.rsrv_date FROM receipt a INNER JOIN result b ON a.rcpt_sq = b.rcpt_sq WHERE a.rcpt_key = ?";
|
||||||
|
$data = [$id];
|
||||||
|
$query = $this->db->query($sql, $data);
|
||||||
|
$row = $query->getRowArray();
|
||||||
|
|
||||||
|
if (!empty($row['usr_sq'])) {
|
||||||
|
$sql2 = "SELECT usr_sq, rsrv_tm_ap, rsrv_tm_hour, COUNT(rsrv_tm_hour) as cnt" .
|
||||||
|
" FROM result" .
|
||||||
|
" WHERE rsrv_date = ?" .
|
||||||
|
" AND usr_sq = ?" .
|
||||||
|
" GROUP BY usr_sq, rsrv_tm_ap, rsrv_tm_hour" .
|
||||||
|
" ORDER BY rsrv_tm_ap, rsrv_tm_hour";
|
||||||
|
|
||||||
|
$data2 = [$row['rsrv_date'], $row['usr_sq']];
|
||||||
|
} else {
|
||||||
|
$sql2 = "SELECT usr_sq, rsrv_tm_ap, rsrv_tm_hour, COUNT(rsrv_tm_hour) as cnt" .
|
||||||
|
" FROM result" .
|
||||||
|
" WHERE rsrv_date = ?" .
|
||||||
|
" AND usr_sq = (SELECT b.usr_sq FROM receipt a, region_codes b WHERE a.rcpt_dong = b.region_cd AND a.rcpt_key = ?)" .
|
||||||
|
" GROUP BY usr_sq, rsrv_tm_ap, rsrv_tm_hour" .
|
||||||
|
" ORDER BY rsrv_tm_ap, rsrv_tm_hour";
|
||||||
|
|
||||||
|
$data2 = [$row['rsrv_date'], $id];
|
||||||
|
}
|
||||||
|
|
||||||
|
$query2 = $this->db->query($sql2, $data2);
|
||||||
|
|
||||||
|
return $query2->getResultArray();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
1331
app/Views/pages/article/receipt/detail.php
Normal file
1331
app/Views/pages/article/receipt/detail.php
Normal file
File diff suppressed because it is too large
Load Diff
@@ -657,6 +657,17 @@ $usr_nm = session('usr_nm');
|
|||||||
ordering: false,
|
ordering: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 테이블 row click
|
||||||
|
$('#resultList tbody').on('click', 'tr', function (e) {
|
||||||
|
if ($(e.target).closest('td.dt-no-rowclick').length) return;
|
||||||
|
|
||||||
|
const rowData = table.row(this).data();
|
||||||
|
if (!rowData) return;
|
||||||
|
|
||||||
|
const rcpt_atclno = rowData.rcpt_atclno;
|
||||||
|
location.href = "<?= site_url('article/receipt/detail') ?>/" + rcpt_atclno;
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
// 엑셀 다운로드 click
|
// 엑셀 다운로드 click
|
||||||
$("#excel-download").on("click", function () {
|
$("#excel-download").on("click", function () {
|
||||||
|
|||||||
Reference in New Issue
Block a user