From f0d59b16941fa6382c425ac0ead9d585f113abe9 Mon Sep 17 00:00:00 2001 From: taekyoungc Date: Fri, 3 Jul 2026 18:35:12 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EB=8B=B4=EB=8B=B9=EC=9E=90=EC=97=90=20?= =?UTF-8?q?=EC=86=8C=EC=86=8D=C2=B7=EC=83=81=ED=98=B8=20=ED=95=84=EB=93=9C?= =?UTF-8?q?=20=EC=B6=94=EA=B0=80(#23)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - manager 테이블에 mg_affiliation(소속)·mg_company_name(상호) 컬럼 추가 (공유 DB 반영 완료 + writable/database에 마이그레이션 SQL 기록) - ManagerModel allowedFields, 등록/수정 폼(담당자명 아래), store/update 저장, 목록에 소속·상호 열 추가 --- app/Controllers/Admin/Manager.php | 8 ++++++++ app/Models/ManagerModel.php | 3 ++- app/Views/admin/manager/create.php | 10 ++++++++++ app/Views/admin/manager/edit.php | 10 ++++++++++ app/Views/admin/manager/index.php | 6 +++++- writable/database/manager_affiliation_company_add.sql | 5 +++++ 6 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 writable/database/manager_affiliation_company_add.sql diff --git a/app/Controllers/Admin/Manager.php b/app/Controllers/Admin/Manager.php index f760937..4741128 100644 --- a/app/Controllers/Admin/Manager.php +++ b/app/Controllers/Admin/Manager.php @@ -77,6 +77,8 @@ class Manager extends BaseController $rules = [ 'mg_name' => 'required|max_length[50]', 'mg_category' => 'required|in_list[company,district,agency]', + 'mg_affiliation' => 'permit_empty|max_length[100]', + 'mg_company_name' => 'permit_empty|max_length[100]', 'mg_tel' => 'permit_empty|max_length[20]', 'mg_phone' => 'permit_empty|max_length[20]', 'mg_email' => 'permit_empty|valid_email|max_length[100]', @@ -88,6 +90,8 @@ class Manager extends BaseController $this->model->insert([ 'mg_lg_idx' => admin_effective_lg_idx(), 'mg_name' => $this->request->getPost('mg_name'), + 'mg_affiliation' => $this->request->getPost('mg_affiliation') ?? '', + 'mg_company_name' => $this->request->getPost('mg_company_name') ?? '', 'mg_dept_code' => (string) ($this->request->getPost('mg_category') ?? ''), 'mg_position_code' => $this->request->getPost('mg_position_code') ?? '', 'mg_tel' => $this->request->getPost('mg_tel') ?? '', @@ -126,6 +130,8 @@ class Manager extends BaseController $rules = [ 'mg_name' => 'required|max_length[50]', 'mg_category' => 'required|in_list[company,district,agency]', + 'mg_affiliation' => 'permit_empty|max_length[100]', + 'mg_company_name' => 'permit_empty|max_length[100]', 'mg_state' => 'required|in_list[0,1]', ]; if (! $this->validate($rules)) { @@ -134,6 +140,8 @@ class Manager extends BaseController $this->model->update($id, [ 'mg_name' => $this->request->getPost('mg_name'), + 'mg_affiliation' => $this->request->getPost('mg_affiliation') ?? '', + 'mg_company_name' => $this->request->getPost('mg_company_name') ?? '', 'mg_dept_code' => (string) ($this->request->getPost('mg_category') ?? ''), 'mg_position_code' => $this->request->getPost('mg_position_code') ?? '', 'mg_tel' => $this->request->getPost('mg_tel') ?? '', diff --git a/app/Models/ManagerModel.php b/app/Models/ManagerModel.php index 2ae9d45..f240b40 100644 --- a/app/Models/ManagerModel.php +++ b/app/Models/ManagerModel.php @@ -13,7 +13,8 @@ class ManagerModel extends Model protected $returnType = 'object'; protected $useTimestamps = false; protected $allowedFields = [ - 'mg_lg_idx', 'mg_name', 'mg_dept_code', 'mg_position_code', + 'mg_lg_idx', 'mg_name', 'mg_affiliation', 'mg_company_name', + 'mg_dept_code', 'mg_position_code', 'mg_tel', 'mg_phone', 'mg_email', 'mg_state', 'mg_regdate', ]; } diff --git a/app/Views/admin/manager/create.php b/app/Views/admin/manager/create.php index 622becf..39578a3 100644 --- a/app/Views/admin/manager/create.php +++ b/app/Views/admin/manager/create.php @@ -10,6 +10,16 @@ +
+ + +
+ +
+ + +
+
+
+ + +
+ +
+ + +
+