use the table name is column names if table is not specified
This commit is contained in:
parent
cf329a20e5
commit
e9bfe4e4ad
@ -276,13 +276,12 @@ class Select
|
|||||||
return [(string) $table, $params];
|
return [(string) $table, $params];
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($table instanceof Select)
|
if ($table instanceof Select) {
|
||||||
{
|
|
||||||
return $table->generateQuery();
|
return $table->generateQuery();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($this->tableAliases[$table])) {
|
if (isset($this->tableAliases[$table])) {
|
||||||
$queryString = ($defineAlias ? Utils::backtick($this->tableAliases[$table]) . ' ' . Utils::backtick($table) : Utils::backtick($table));
|
$queryString = $defineAlias ? Utils::backtick($this->tableAliases[$table]) . ' ' . Utils::backtick($table) : Utils::backtick($table);
|
||||||
return [$queryString, $params];
|
return [$queryString, $params];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -295,24 +294,17 @@ class Select
|
|||||||
return (string) $column;
|
return (string) $column;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_array($column)) {
|
if (!is_array($column)) {
|
||||||
$out = '';
|
$column = [$this->table, $column];
|
||||||
|
|
||||||
if ($column[0]) {
|
|
||||||
list($tableName, $params) = $this->generateTable($column[0]);
|
|
||||||
$out .= $tableName . '.';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$out .= Utils::backtick($column[1]);
|
list($tableName, $params) = $this->generateTable($column[0]);
|
||||||
|
$out = $tableName . '.' . Utils::backtick($column[1]);
|
||||||
if (!empty($column[2])) {
|
if (!empty($column[2])) {
|
||||||
$out .= ' ' . Utils::backtick($column[2]);
|
$out .= ' ' . Utils::backtick($column[2]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $out;
|
return $out;
|
||||||
} else {
|
|
||||||
return Utils::backtick($column);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private function generateColumns(): string
|
private function generateColumns(): string
|
||||||
|
Loading…
Reference in New Issue
Block a user