dbms_primeidc_init...1
This commit is contained in:
parent
c1e34c7eaa
commit
a6b43c08f2
@ -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;
|
||||
}
|
||||
|
||||
@ -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());
|
||||
|
||||
Loading…
Reference in New Issue
Block a user