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 @@ +
+ + +
+ +
+ + +
+
+
+ + +
+ +
+ + +
+