diff --git a/app/Controllers/Bag.php b/app/Controllers/Bag.php index 662d676..9f7486b 100644 --- a/app/Controllers/Bag.php +++ b/app/Controllers/Bag.php @@ -331,7 +331,6 @@ class Bag extends BaseController { $lgIdx = $this->lgIdx(); $packagingUnits = []; - $dbDiag = null; if ($lgIdx) { try { $packagingUnits = model(PackagingUnitModel::class)->where('pu_lg_idx', $lgIdx)->orderBy('pu_bag_code', 'ASC')->findAll(); @@ -340,53 +339,7 @@ class Bag extends BaseController } } - if ($this->request->getGet('db_diag') === '1') { - $dbDiag = [ - 'lg_idx' => $lgIdx, - 'cfg_host' => null, - 'cfg_port' => null, - 'cfg_user' => null, - 'db_name' => null, - 'mysql_host' => null, - 'mysql_port' => null, - 'mysql_version' => null, - 'packaging_unit' => null, - 'code_kind' => null, - 'code_detail' => null, - 'error' => null, - ]; - try { - $db = db_connect(); - $cfg = config('Database')->default ?? []; - $dbDiag['cfg_host'] = $cfg['hostname'] ?? null; - $dbDiag['cfg_port'] = isset($cfg['port']) ? (string) $cfg['port'] : null; - $dbDiag['cfg_user'] = $cfg['username'] ?? null; - $dbDiag['db_name'] = $db->database; - $meta = $db->query('SELECT @@hostname AS mysql_host, @@port AS mysql_port, @@version AS mysql_version, DATABASE() AS db_name')->getRowArray(); - if (is_array($meta)) { - $dbDiag['mysql_host'] = $meta['mysql_host'] ?? null; - $dbDiag['mysql_port'] = isset($meta['mysql_port']) ? (string) $meta['mysql_port'] : null; - $dbDiag['mysql_version'] = $meta['mysql_version'] ?? null; - if (! empty($meta['db_name'])) { - $dbDiag['db_name'] = (string) $meta['db_name']; - } - } - $dbDiag['packaging_unit'] = (int) $db->table('packaging_unit')->where('pu_lg_idx', (int) $lgIdx)->countAllResults(); - $dbDiag['code_kind'] = (int) $db->table('code_kind')->countAllResults(); - $dbDiag['code_detail'] = (int) $db->table('code_detail')->countAllResults(); - } catch (\Throwable $e) { - $dbDiag['error'] = $e->getMessage(); - log_message('error', '[packagingUnits][db_diag] {type}: {message}', [ - 'type' => $e::class, - 'message' => $e->getMessage(), - ]); - } - } - - return $this->render('포장 단위', 'bag/packaging_units', [ - 'packagingUnits' => $packagingUnits, - 'dbDiag' => $dbDiag, - ]); + return $this->render('포장 단위', 'bag/packaging_units', ['packagingUnits' => $packagingUnits]); } /** diff --git a/app/Views/bag/packaging_units.php b/app/Views/bag/packaging_units.php index 9772580..23e325b 100644 --- a/app/Views/bag/packaging_units.php +++ b/app/Views/bag/packaging_units.php @@ -1,23 +1,4 @@
← 기본정보관리 |