dbms_init...1

This commit is contained in:
choi.jh 2025-08-12 17:26:13 +09:00
parent 3dab3cc25f
commit 749afd83bc
6 changed files with 28 additions and 6 deletions

View File

@ -397,3 +397,10 @@ define('SERVICE_ITEM_TYPES', $_ENV['SERVICEINFO_ITEM_TYPES']
define('SERVICE_NEW_INTERVAL', $_ENV['SERVICE_NEW_INTERVAL'] ?? $_SERVER['SERVICE_NEW_INTERVAL'] ?? 7); define('SERVICE_NEW_INTERVAL', $_ENV['SERVICE_NEW_INTERVAL'] ?? $_SERVER['SERVICE_NEW_INTERVAL'] ?? 7);
//미지급 Item_type //미지급 Item_type
define('SERVICE_UNPAID_ITEM_TYPE', $_ENV['SERVICE_UNPAID_ITEM_TYPE'] ?? $_SERVER['SERVICE_UNPAID_ITEM_TYPE'] ?? "SERVER"); define('SERVICE_UNPAID_ITEM_TYPE', $_ENV['SERVICE_UNPAID_ITEM_TYPE'] ?? $_SERVER['SERVICE_UNPAID_ITEM_TYPE'] ?? "SERVER");
define(
'SITE_PREFIX',
[
'Client' => $_ENV['PREFIX_Client'] ?? $_SERVER['PREFIX_Client'] ?? 'C',
'Service' => $_ENV['PREFIX_Service'] ?? $_SERVER['PREFIX_Service'] ?? 'S'
],
);

View File

@ -58,4 +58,12 @@ class ClientModel extends CustomerModel
} }
return $rule; return $rule;
} }
protected function create_process(array $formDatas): ClientEntity
{
$entity = parent::create_process($formDatas);
// 생성 후, 추가 작업이 필요할 경우 여기에 작성
$formDatas = ['code' => SITE_PREFIX['Client'] . $entity->getPK()];
return $this->modify($entity, $formDatas);
}
} }

View File

@ -69,7 +69,8 @@ class ServiceModel extends CustomerModel
protected function create_process(array $formDatas): ServiceEntity protected function create_process(array $formDatas): ServiceEntity
{ {
$entity = parent::create_process($formDatas); $entity = parent::create_process($formDatas);
//고객코드 Code 자동 생성 후(timestamp값) 수정 // 생성 후, 추가 작업이 필요할 경우 여기에 작성
return $this->modify($entity, ['code' => 'S' . time()]); $formDatas = ['code' => SITE_PREFIX['Service'] . time()];
return $this->modify($entity, $formDatas);
} }
} }

View File

@ -75,7 +75,7 @@ abstract class CommonService
throw new \Exception($message); throw new \Exception($message);
} }
} }
protected function findAllDatas(array $columns = ['*']): mixed protected function findAllDatas_process(array $columns = ['*']): mixed
{ {
return $this->getModel()->select(implode(',', $columns))->findAll(); return $this->getModel()->select(implode(',', $columns))->findAll();
} }
@ -86,7 +86,7 @@ abstract class CommonService
$this->getModel()->where($where); $this->getModel()->where($where);
} }
$entities = []; $entities = [];
foreach ($this->findAllDatas($columns) as $entity) { foreach ($this->findAllDatas_process($columns) as $entity) {
$entities[$entity->getPK()] = $entity; $entities[$entity->getPK()] = $entity;
} }
return $entities; return $entities;

View File

@ -132,4 +132,10 @@ class ClientService extends CustomerService
$this->getModel()->orLike($this->getModel()->getTable() . '.email', $word, 'both'); $this->getModel()->orLike($this->getModel()->getTable() . '.email', $word, 'both');
parent::setList_WordFilter($word); parent::setList_WordFilter($word);
} }
//OrderBy 처리
public function setOrderBy(mixed $field = null, mixed $value = null): void
{
$this->getModel()->orderBy("name", 'ASC');
parent::setOrderBy($field, $value);
}
} }

View File

@ -95,7 +95,7 @@ class ServiceService extends CustomerService
{ {
return $this->_searchIP; return $this->_searchIP;
} }
protected function findAllDatas(array $columns = ['*']): mixed protected function findAllDatas_process(array $columns = ['*']): mixed
{ {
$ip = $this->getSearchIp(); $ip = $this->getSearchIp();
if ($ip) { if ($ip) {
@ -105,7 +105,7 @@ class ServiceService extends CustomerService
AND serviceinfo_items.item_uid IN (SELECT uid FROM ipinfo WHERE ip = ?)"; AND serviceinfo_items.item_uid IN (SELECT uid FROM ipinfo WHERE ip = ?)";
return $this->getModel()->query($sql, ['IP', $ip])->getResult(ServiceEntity::class); return $this->getModel()->query($sql, ['IP', $ip])->getResult(ServiceEntity::class);
} }
return parent::findAllDatas($columns); return parent::findAllDatas_process($columns);
} }
//기본 기능부분 //기본 기능부분
//FieldForm관련용 //FieldForm관련용