dbmsv3 init...1
This commit is contained in:
parent
7e0b413a6b
commit
5d89fc7639
@ -56,8 +56,7 @@ class SearchController extends AdminController
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
protected function getChildServers(ServiceEntity $entity): array
|
||||
private function getChildServers(ServiceEntity $entity): array
|
||||
{
|
||||
$servers = [];
|
||||
foreach ($this->getServerService()->getEntities(['serviceinfo_uid' => $entity->getPK()]) as $serverEntity) {
|
||||
@ -70,8 +69,6 @@ class SearchController extends AdminController
|
||||
}
|
||||
return $servers;
|
||||
}
|
||||
//
|
||||
|
||||
protected function index_process(array $entities = []): array
|
||||
{
|
||||
$keyword = $this->request->getGet('keyword'); // 검색어
|
||||
@ -104,14 +101,13 @@ class SearchController extends AdminController
|
||||
// echo $builder->getCompiledSelect();
|
||||
// exit;
|
||||
$results = $builder->get()->getResultArray();
|
||||
// dd($results);
|
||||
if (!count($results)) {
|
||||
return [];
|
||||
}
|
||||
$uids = [];
|
||||
foreach ($results as $result) {
|
||||
$uids[] = "'{$result['serviceinfo_uid']}'";
|
||||
}
|
||||
if (!count($uids)) {
|
||||
return [];
|
||||
}
|
||||
//서비스별 미납 Count
|
||||
$childServers = [];
|
||||
foreach ($this->getService()->getEntities("uid IN (" . implode(",", $uids) . ")") as $entity) {
|
||||
|
||||
@ -134,6 +134,10 @@ abstract class CommonService
|
||||
$this->setControlDatas('field_optons', $options);
|
||||
}
|
||||
//Entity별로 작업처리시
|
||||
final public function getLastQuery(): string
|
||||
{
|
||||
return $this->getModel()->getLastQuery();
|
||||
}
|
||||
protected function getEntity_process(mixed $entity): mixed
|
||||
{
|
||||
return $entity;
|
||||
@ -153,7 +157,7 @@ abstract class CommonService
|
||||
$message = sprintf(
|
||||
"\n------%s SQL오류-----<BR>\n%s\n%s\n------------------------------\n",
|
||||
__FUNCTION__,
|
||||
$this->getModel()->getLastQuery(),
|
||||
$this->getLastQuery(),
|
||||
$e->getMessage()
|
||||
);
|
||||
throw new \Exception($message);
|
||||
@ -176,12 +180,7 @@ abstract class CommonService
|
||||
final public function getEntities(mixed $where = null, array $columns = ['*']): array
|
||||
{
|
||||
try {
|
||||
$entities = $this->getEntities_process($where, $columns);
|
||||
$debug = sprintf("debug.%s.%s", str_replace("\\", ".", get_class($this)), __FUNCTION__);
|
||||
if (env($debug, false)) {
|
||||
echo $this->getModel()->getLastQuery();
|
||||
}
|
||||
return $entities;
|
||||
return $this->getEntities_process($where, $columns);
|
||||
} catch (\Exception $e) {
|
||||
$message = sprintf(
|
||||
"\n------%s SQL오류-----<BR>\n%s\n%s\n------------------------------\n",
|
||||
|
||||
@ -186,9 +186,6 @@ class ServerService extends EquipmentService implements ServiceInterface
|
||||
case 'serviceinfo_uid':
|
||||
$options = $this->getServiceService()->getEntities();
|
||||
break;
|
||||
// case 'ip':
|
||||
// $options = $this->getIPService()->getEntities();
|
||||
// break;
|
||||
default:
|
||||
$options = parent::getFormOption($field, $options);
|
||||
break;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user