From ab39be960221c24c30e3da4e330b4c473b2c2a73 Mon Sep 17 00:00:00 2001 From: yangsh Date: Fri, 26 Dec 2025 18:02:57 +0900 Subject: [PATCH] =?UTF-8?q?=ED=8F=89=EB=A9=B4=EB=8F=84=20=EC=83=81?= =?UTF-8?q?=EC=84=B8=20=ED=99=94=EB=A9=B4=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Config/Routes.php | 1 + app/Controllers/Article/Ground.php | 19 +++++ app/Models/article/GroundModel.php | 30 +++++++ app/Views/pages/article/detail2.php | 128 ++++++++++++++++++++++++++++ app/Views/pages/article/lists2.php | 5 +- 5 files changed, 181 insertions(+), 2 deletions(-) create mode 100644 app/Views/pages/article/detail2.php diff --git a/app/Config/Routes.php b/app/Config/Routes.php index ece01fe..e47dbc7 100644 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -95,6 +95,7 @@ $routes->group('article', ['namespace' => 'App\Controllers\Article'], function ( // 아파트 평면도 $routes->get('apt/lists2', 'Ground::lists'); + $routes->get('apt/ground/detail/(:num)/(:num)', 'Ground::detail/$1/$2'); /** * 아파트 평면도 - API diff --git a/app/Controllers/Article/Ground.php b/app/Controllers/Article/Ground.php index db20cd4..79a820e 100644 --- a/app/Controllers/Article/Ground.php +++ b/app/Controllers/Article/Ground.php @@ -209,6 +209,25 @@ class Ground extends BaseController } + // 상세화면 + public function detail($rcpt_no, $hscp_no): string + { + + if ($rcpt_no == null || $hscp_no == null) { + throw \CodeIgniter\Exceptions\PageNotFoundException::forPageNotFound(); + } + + // 상세정보 + $apt = $this->model->getDetail($rcpt_no, $hscp_no); + + + return view("pages/article/detail2", [ + 'apt' => $apt, + ]); + } + + + // 파일업로드(평면도) public function uploadFile() { diff --git a/app/Models/article/GroundModel.php b/app/Models/article/GroundModel.php index b7f8955..cd51011 100644 --- a/app/Models/article/GroundModel.php +++ b/app/Models/article/GroundModel.php @@ -625,6 +625,35 @@ class GroundModel extends Model ]; } + // 상세정보 + public function getDetail($rcpt_no, $hscp_no) + { + $sql = "SELECT + a.rcpt_no, a.hscp_no, a.part_no, a.addr, a.addr2, a.rcpt_hscp_nm, a.move_ym, a.households_cnt, a.dong_cnt, a.pyeong_cnt, a.apt_cate_nm, a.region_cd, a.rcpt_x, a.rcpt_y + ,a.vdo_up_tm, DATE_FORMAT(a.vdo_up_tm, '%Y-%m-%d') as rdate_dt_vdo ,DATE_FORMAT(a.vdo_up_tm, '%H:%i:%s') as rdate_tm_vdo + ,a.check_tm, DATE_FORMAT(a.check_tm, '%Y-%m-%d') as rdate_dt_chk ,DATE_FORMAT(a.check_tm, '%H:%i:%s') as rdate_tm_chk + ,a.memo, a.note, a.video_target, a.vdo_up_ynx, a.not_vdo_reson, a.apt_step, a.check_yn, a.resend_yn, a.write_complete_yn, a.all_no_pho + ,a.write_complete_tm, DATE_FORMAT(a.write_complete_tm, '%Y-%m-%d') as rdate_dt_cmpl ,DATE_FORMAT(a.write_complete_tm, '%H:%i:%s') as rdate_tm_cmpl + ,a.charger, a.dept_sq ,(SELECT pdept_sq FROM departments WHERE dept_sq = a.dept_sq) bonbu + ,a.send_end_tm, a.supply_no_tm + ,d.pho_cate2, d.pho_explain, d.pho_up_nu + ,gp.filenm_up, gp.file_path, gp.insert_tm + FROM + apt_ground a + LEFT JOIN apt_category d ON a.rcpt_no = d.rcpt_no + LEFT JOIN apt_ground_photo gp ON gp.pho_no = (SELECT p.pho_no + FROM apt_ground_photo p + WHERE p.rcpt_no = a.rcpt_no + ORDER BY p.pho_no DESC + LIMIT 1) + + WHERE a.rcpt_no = {$rcpt_no} AND a.hscp_no = {$hscp_no} "; + + $query = $this->db->query($sql, [$rcpt_no]); + + return $query->getRowArray(); + } + // 평면도 정보 저장 public function saveImg($data) @@ -648,4 +677,5 @@ class GroundModel extends Model 'success' => true, ]; } + } \ No newline at end of file diff --git a/app/Views/pages/article/detail2.php b/app/Views/pages/article/detail2.php new file mode 100644 index 0000000..e34c064 --- /dev/null +++ b/app/Views/pages/article/detail2.php @@ -0,0 +1,128 @@ +extend('layouts/main') ?> + +section('content') ?> + + +
+
+ +
+
+
단지 정보
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
단지코드주소
단지명상세주소
입주년월총세대수
총동수메모 +
+
+ +
+
+ +
+
+
+
+
+
+ +
+ +endSection() ?> \ No newline at end of file diff --git a/app/Views/pages/article/lists2.php b/app/Views/pages/article/lists2.php index e198b2f..cb5d36c 100644 --- a/app/Views/pages/article/lists2.php +++ b/app/Views/pages/article/lists2.php @@ -673,8 +673,9 @@ const rowData = table.row(this).data(); if (!rowData) return; - // const id = rowData.rcpt_no; - // location.href = "/" + id; + const rcpt_no = rowData.rcpt_no; + const hscp_no = rowData.hscp_no; + location.href = "/" + rcpt_no + "/" + hscp_no; }); $('#btnSearch').on('click', function () {