chore: add db diagnostic mode on packaging units page

Expose a temporary db_diag=1 view for /bag/packaging-units so we can verify runtime DB connectivity and required table counts directly on production.
This commit is contained in:
taekyoungc
2026-04-09 12:39:09 +09:00
parent aa50eb72ee
commit 8753b1aa68
2 changed files with 42 additions and 1 deletions

View File

@@ -1,4 +1,17 @@
<div class="space-y-4">
<?php if (isset($dbDiag) && is_array($dbDiag)): ?>
<section class="rounded border border-amber-300 bg-amber-50 px-3 py-2 text-xs text-amber-900">
<div class="font-semibold mb-1">DB 진단 모드</div>
<div>lg_idx: <?= esc((string) ($dbDiag['lg_idx'] ?? 'null')) ?></div>
<div>database: <?= esc((string) ($dbDiag['db_name'] ?? '')) ?></div>
<div>packaging_unit(현재 lg): <?= esc((string) ($dbDiag['packaging_unit'] ?? 'null')) ?></div>
<div>code_kind: <?= esc((string) ($dbDiag['code_kind'] ?? 'null')) ?></div>
<div>code_detail: <?= esc((string) ($dbDiag['code_detail'] ?? 'null')) ?></div>
<?php if (! empty($dbDiag['error'])): ?>
<div class="mt-1 text-red-700">error: <?= esc((string) $dbDiag['error']) ?></div>
<?php endif; ?>
</section>
<?php endif; ?>
<p class="text-sm text-gray-600">
<a href="<?= base_url('bag/basic-info') ?>" class="text-blue-600 hover:underline">&larr; 기본정보관리</a>
<span class="mx-2 text-gray-300">|</span>