dbms_primeidc_init...1

This commit is contained in:
최준흠 2025-04-09 13:01:21 +09:00
parent c1e34c7eaa
commit a6b43c08f2
2 changed files with 16 additions and 13 deletions

View File

@ -38,23 +38,20 @@ class ServerController extends DBMSController
$lineup_explode = explode('.', $entity->getSpec());
$spec = $lineup_explode[0];
$cpu = $entity->getCPUName();
$this->getServerService()->getModel()->like("server_cpuname", $cpu, "both");
$this->getServerService()->getModel()->like("server_spec", $spec, "both");
$this->getServerService()->getModel()->like(["server_cpuname" => "%$cpu%", "server_spec" => "%$spec%"]);
$entity->all = $this->getServerService()->getCount();
$this->getServerService()->getModel()->where("server_use_status", "n");
$this->getServerService()->getModel()->like("server_cpuname", $cpu, "both");
$this->getServerService()->getModel()->like("server_spec", $spec, "both");
$this->getServerService()->getModel()->like(["server_cpuname" => "%$cpu%", "server_spec" => "%$spec%"]);
$entity->use = $this->getServerService()->getCount();
$this->getServerService()->getModel()->where("server_use_status", "y");
$this->getServerService()->getModel()->like("server_cpuname", $cpu, "both");
$this->getServerService()->getModel()->like("server_spec", $spec, "both");
$this->getServerService()->getModel()->like(["server_cpuname" => "%$cpu%", "server_spec" => "%$spec%"]);
$entity->empty = $this->getServerService()->getCount();
$this->getServerService()->getModel()->where("server_use_status", "y");
$this->getServerService()->getModel()->like("server_cpuname", $cpu, "both");
$this->getServerService()->getModel()->where("server_fomat_date !='NULL'");
$this->getServerService()->getModel()->like(["server_cpuname" => "%$cpu%"]);
$entity->format = $this->getServerService()->getCount();
return $entity;
}

View File

@ -61,8 +61,14 @@ class QueryBuilder
{
$sql = '';
foreach ($this->where as $index => $clause) {
$boolean = $index === 0 ? '' : $clause['boolean'] . ' ';
$sql .= $boolean . $clause['condition'] . ' ';
if (is_array($clause)) {
$boolean = $index === 0 ? '' : $clause['boolean'] . ' ';
$sql .= $boolean . $clause['condition'] . ' ';
} else {
// 문자열 형태일 경우 (like에서 사용됨)
$boolean = $index === 0 ? '' : 'AND ';
$sql .= $boolean . $clause . ' ';
}
}
return trim($sql);
}
@ -233,8 +239,7 @@ class QueryBuilder
//binding까지 완료한 SQL문을 return함
final public function toRawSql(): string
{
$sql = $this->buildSelectSql();
$raw = $sql;
$raw = $this->buildSelectSql();
foreach ($this->bindings as $key => $value) {
$escaped = is_numeric($value) ? $value : $this->pdo->quote($value);
// 명명된 바인딩
@ -249,9 +254,10 @@ class QueryBuilder
}
final public function get(): array
{
$sql = $this->buildSelectSql();
if ($this->_debug) {
echo "\n<BR>SQL DEBUG:" . $this->toRawSql() . "<BR>";
echo php_sapi_name() === 'cli'
? "\nSQL DEBUG: " . $this->toRawSql() . "\n"
: "<pre>SQL DEBUG: " . $this->toRawSql() . "</pre>";
}
$this->latestQuery = $this->toRawSql();
$stmt = $this->pdo->prepare($this->buildSelectSql());