eee
This commit is contained in:
+15
-1
@@ -40,7 +40,7 @@ abstract class QueryTrait extends Component implements ActiveQueryInterface, ISq
|
||||
protected bool $lock = FALSE;
|
||||
protected SqlBuilder $builder;
|
||||
protected array $params = [];
|
||||
protected array $_alias = ['t1.*'];
|
||||
protected array $_alias = [];
|
||||
|
||||
|
||||
/**
|
||||
@@ -74,6 +74,20 @@ abstract class QueryTrait extends Component implements ActiveQueryInterface, ISq
|
||||
}
|
||||
|
||||
|
||||
public function whereNotExists(Closure|string $callback, array $attributes = []): static
|
||||
{
|
||||
if (is_string($callback)) {
|
||||
$this->where[] = $callback;
|
||||
} else {
|
||||
$this->where[] = 'NOT EXISTS(' . $this->makeClosureFunction($callback) . ')';
|
||||
}
|
||||
if (count($attributes) > 0) {
|
||||
$this->bindParams($attributes);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param array $select
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user