업체·담당자·단가·지정판매소 관리 화면의 조회 및 표시를 개선한다.

관리 화면에서 유형별 조회와 순번 표기를 통일하고, 지정판매소 주소/구군 표시와 포장단위 이력 표현을 사용자 관점으로 정리한다.

Made-with: Cursor
This commit is contained in:
taekyoungc
2026-04-22 15:35:28 +09:00
parent 647d5f919d
commit 05c479397b
16 changed files with 433 additions and 83 deletions

View File

@@ -143,14 +143,31 @@ class PackagingUnit extends BaseController
$db = \Config\Database::connect();
$db->transStart();
$trackFields = ['pu_box_per_pack', 'pu_pack_per_sheet'];
$trackFields = ['pu_box_per_pack', 'pu_pack_per_sheet', 'pu_start_date', 'pu_end_date', 'pu_state'];
$fieldLabels = [
'pu_box_per_pack' => '박스당 팩 수',
'pu_pack_per_sheet' => '팩당 낱장 수',
'pu_start_date' => '적용시작일',
'pu_end_date' => '적용종료일',
'pu_state' => '상태',
];
foreach ($trackFields as $field) {
$oldVal = (string) $item->$field;
$newVal = (string) $this->request->getPost($field);
$oldRaw = $item->$field;
$newRaw = $this->request->getPost($field);
if ($field === 'pu_end_date') {
$oldRaw = $oldRaw ?: '';
$newRaw = $newRaw ?: '';
}
if ($field === 'pu_state') {
$oldRaw = (int) $oldRaw === 1 ? '사용' : '미사용';
$newRaw = (int) $newRaw === 1 ? '사용' : '미사용';
}
$oldVal = (string) $oldRaw;
$newVal = (string) $newRaw;
if ($oldVal !== $newVal) {
$this->historyModel->insert([
'puh_pu_idx' => $id,
'puh_field' => $field,
'puh_field' => $fieldLabels[$field] ?? $field,
'puh_old_value' => $oldVal,
'puh_new_value' => $newVal,
'puh_changed_at' => date('Y-m-d H:i:s'),