mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-02-14 23:48:40 +00:00
Fix pull out bug
This commit is contained in:
parent
8207096687
commit
ed275f9c34
|
|
@ -114,12 +114,13 @@ class Grammar extends GrammarAbstract
|
||||||
protected function compileComponents(BuilderAbstract $query) : array
|
protected function compileComponents(BuilderAbstract $query) : array
|
||||||
{
|
{
|
||||||
$sql = [];
|
$sql = [];
|
||||||
$components = $this->getComponents($query->getType());
|
|
||||||
|
|
||||||
if($query->getType() === QueryType::RAW) {
|
if($query->getType() === QueryType::RAW) {
|
||||||
return $components;
|
return [$query->raw];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$components = $this->getComponents($query->getType());
|
||||||
|
|
||||||
/* Loop all possible query components and if they exist compile them. */
|
/* Loop all possible query components and if they exist compile them. */
|
||||||
foreach ($components as $component) {
|
foreach ($components as $component) {
|
||||||
if (isset($query->{$component}) && !empty($query->{$component})) {
|
if (isset($query->{$component}) && !empty($query->{$component})) {
|
||||||
|
|
@ -143,8 +144,6 @@ class Grammar extends GrammarAbstract
|
||||||
return $components = $this->deleteComponents;
|
return $components = $this->deleteComponents;
|
||||||
case QueryType::RANDOM:
|
case QueryType::RANDOM:
|
||||||
return $components = $this->selectComponents;
|
return $components = $this->selectComponents;
|
||||||
case QueryType::RAW:
|
|
||||||
return [$query->raw];
|
|
||||||
default:
|
default:
|
||||||
throw new \InvalidArgumentException('Unknown query type.');
|
throw new \InvalidArgumentException('Unknown query type.');
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user