From f9da1086da6a264dd12eafc484e201e77f55220f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B5=9C=EC=A4=80=ED=9D=A0?= Date: Thu, 3 Apr 2025 12:01:57 +0900 Subject: [PATCH] dbms_primeidc_init...1 --- .../lib/Controllers/DBMS/NavigatorController.php | 8 +++++++- extdbms/lib/Core/Model.php | 15 +++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/extdbms/lib/Controllers/DBMS/NavigatorController.php b/extdbms/lib/Controllers/DBMS/NavigatorController.php index 385c7d0..378fe94 100644 --- a/extdbms/lib/Controllers/DBMS/NavigatorController.php +++ b/extdbms/lib/Controllers/DBMS/NavigatorController.php @@ -31,7 +31,13 @@ class NavigatorController extends BaseController $clients = []; $ip = $this->getRequest('ip'); //IP형식이 ipv4인지 확인 후 값가져오기 - $services = $ip && $this->helper->isIPAddress($ip) ? $this->getServiceervice()->getEntitysByIP($ip) : $this->getServiceervice()->getEntitys(); + $services = []; + if ($ip && $this->helper->isIPAddress($ip)) { + $services = $this->getServiceervice()->getEntitysByIP($ip); + } else { + $this->getServiceervice()->getModel()->like($ip); + $this->getServiceervice()->getEntitys(); + } foreach ($services as $service) { $clients[$service->getPK()] = $this->getClientService()->getEntityByCode($service->getClientCode()); } diff --git a/extdbms/lib/Core/Model.php b/extdbms/lib/Core/Model.php index c14ef70..91f2784 100644 --- a/extdbms/lib/Core/Model.php +++ b/extdbms/lib/Core/Model.php @@ -149,6 +149,21 @@ abstract class Model { $this->_querys["JOIN"] = " {$type} JOIN {$table} ON {$match}"; } + final public function like(string $column, string $value, string $option = "both"): void + { + switch ($option) { + case 'before': + $value = "%{$value}"; + break; + case 'after': + $value = "{$value}%"; + break; + default: + $value = "%{$value}%"; + break; + } + $this->_querys["LIKE"] = "{$column} LIKE '{$$value}'"; + } final public function orderBy(string $column, string $direction = "DESC"): void { $this->_querys["ORDERBY"] = " ORDER BY {$column} {$direction}";