dbms_primeidc_init...1

This commit is contained in:
최준흠 2025-04-03 12:01:57 +09:00
parent bfc645820b
commit f9da1086da
2 changed files with 22 additions and 1 deletions

View File

@ -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());
}

View File

@ -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}";