eee
This commit is contained in:
+1
-1
@@ -327,7 +327,7 @@ abstract class Model extends Component implements ModelInterface, ArrayAccess, \
|
|||||||
public static function query(): ActiveQuery
|
public static function query(): ActiveQuery
|
||||||
{
|
{
|
||||||
$model = new ActiveQuery(static::instance());
|
$model = new ActiveQuery(static::instance());
|
||||||
$model->from($model->getTable())->alias('t1');
|
$model->select()->from($model->getTable())->alias('t1');
|
||||||
return $model;
|
return $model;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+15
-1
@@ -40,7 +40,7 @@ abstract class QueryTrait extends Component implements ActiveQueryInterface, ISq
|
|||||||
protected bool $lock = FALSE;
|
protected bool $lock = FALSE;
|
||||||
protected SqlBuilder $builder;
|
protected SqlBuilder $builder;
|
||||||
protected array $params = [];
|
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
|
* @param array $select
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user