feat: 담당자에 소속·상호 필드 추가(#23)
- manager 테이블에 mg_affiliation(소속)·mg_company_name(상호) 컬럼 추가 (공유 DB 반영 완료 + writable/database에 마이그레이션 SQL 기록) - ManagerModel allowedFields, 등록/수정 폼(담당자명 아래), store/update 저장, 목록에 소속·상호 열 추가
This commit is contained in:
@@ -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') ?? '',
|
||||
|
||||
Reference in New Issue
Block a user