eee
This commit is contained in:
@@ -84,6 +84,7 @@ abstract class QueryTrait extends Component implements ActiveQueryInterface, ISq
|
|||||||
{
|
{
|
||||||
if ($callback instanceof Query) {
|
if ($callback instanceof Query) {
|
||||||
$this->where[] = 'NOT EXISTS(' . $callback->build() . ')';
|
$this->where[] = 'NOT EXISTS(' . $callback->build() . ')';
|
||||||
|
$this->mergeParams($callback->getParams());
|
||||||
} else {
|
} else {
|
||||||
$this->where[] = 'NOT EXISTS(' . $this->makeClosureFunction($callback) . ')';
|
$this->where[] = 'NOT EXISTS(' . $this->makeClosureFunction($callback) . ')';
|
||||||
}
|
}
|
||||||
@@ -104,6 +105,7 @@ abstract class QueryTrait extends Component implements ActiveQueryInterface, ISq
|
|||||||
{
|
{
|
||||||
if ($callback instanceof Query) {
|
if ($callback instanceof Query) {
|
||||||
$this->where[] = 'EXISTS(' . $callback->build() . ')';
|
$this->where[] = 'EXISTS(' . $callback->build() . ')';
|
||||||
|
$this->mergeParams($callback->getParams());
|
||||||
} else {
|
} else {
|
||||||
$this->where[] = 'EXISTS(' . $this->makeClosureFunction($callback) . ')';
|
$this->where[] = 'EXISTS(' . $this->makeClosureFunction($callback) . ')';
|
||||||
}
|
}
|
||||||
@@ -302,6 +304,18 @@ abstract class QueryTrait extends Component implements ActiveQueryInterface, ISq
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param array $params
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function mergeParams(array $params): void
|
||||||
|
{
|
||||||
|
foreach ($params as $key => $value) {
|
||||||
|
$this->pushParam($value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $column
|
* @param string $column
|
||||||
* @param callable $callable
|
* @param callable $callable
|
||||||
@@ -442,6 +456,7 @@ abstract class QueryTrait extends Component implements ActiveQueryInterface, ISq
|
|||||||
{
|
{
|
||||||
if ($tableName instanceof Query) {
|
if ($tableName instanceof Query) {
|
||||||
$this->from = '(' . $tableName->build() . ')';
|
$this->from = '(' . $tableName->build() . ')';
|
||||||
|
$this->mergeParams($tableName->getParams());
|
||||||
} else if ($tableName instanceof Closure) {
|
} else if ($tableName instanceof Closure) {
|
||||||
$this->from = '(' . $this->makeClosureFunction($tableName) . ')';
|
$this->from = '(' . $this->makeClosureFunction($tableName) . ')';
|
||||||
} else if (class_exists($tableName)) {
|
} else if (class_exists($tableName)) {
|
||||||
@@ -806,6 +821,7 @@ abstract class QueryTrait extends Component implements ActiveQueryInterface, ISq
|
|||||||
$this->where[] = $columns . ' IN (' . implode(',', $value) . ')';
|
$this->where[] = $columns . ' IN (' . implode(',', $value) . ')';
|
||||||
} else if ($value instanceof Query) {
|
} else if ($value instanceof Query) {
|
||||||
$this->where[] = $columns . ' IN (' . $value->build() . ')';
|
$this->where[] = $columns . ' IN (' . $value->build() . ')';
|
||||||
|
$this->mergeParams($value->getParams());
|
||||||
} else {
|
} else {
|
||||||
$this->where[] = $columns . ' IN (' . $this->makeClosureFunction($value) . ')';
|
$this->where[] = $columns . ' IN (' . $this->makeClosureFunction($value) . ')';
|
||||||
}
|
}
|
||||||
@@ -953,6 +969,7 @@ abstract class QueryTrait extends Component implements ActiveQueryInterface, ISq
|
|||||||
} else {
|
} else {
|
||||||
$generate->addArray($closure);
|
$generate->addArray($closure);
|
||||||
}
|
}
|
||||||
|
$this->mergeParams($generate->getParams());
|
||||||
return $generate->build();
|
return $generate->build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user