变更
This commit is contained in:
+4
-4
@@ -230,7 +230,7 @@ class ActiveQuery extends Component implements ISqlBuilder
|
|||||||
*/
|
*/
|
||||||
public function all(): Collection|array
|
public function all(): Collection|array
|
||||||
{
|
{
|
||||||
$data = $this->execute($this->builder->all())->all();
|
$data = $this->execute($this->builder->all(), $this->attributes)->all();
|
||||||
if ($data === false) {
|
if ($data === false) {
|
||||||
return new Collection($this, [], $this->modelClass);
|
return new Collection($this, [], $this->modelClass);
|
||||||
}
|
}
|
||||||
@@ -262,7 +262,7 @@ class ActiveQuery extends Component implements ISqlBuilder
|
|||||||
*/
|
*/
|
||||||
public function count(): int
|
public function count(): int
|
||||||
{
|
{
|
||||||
$data = $this->execute($this->builder->count())->one();
|
$data = $this->execute($this->builder->count(), $this->attributes)->one();
|
||||||
if ($data && is_array($data)) {
|
if ($data && is_array($data)) {
|
||||||
return (int)array_shift($data);
|
return (int)array_shift($data);
|
||||||
}
|
}
|
||||||
@@ -317,7 +317,7 @@ class ActiveQuery extends Component implements ISqlBuilder
|
|||||||
*/
|
*/
|
||||||
public function exists(): bool
|
public function exists(): bool
|
||||||
{
|
{
|
||||||
return !empty($this->execute($this->builder->one())->fetchColumn());
|
return !empty($this->execute($this->builder->one(), $this->attributes)->fetchColumn());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -330,7 +330,7 @@ class ActiveQuery extends Component implements ISqlBuilder
|
|||||||
{
|
{
|
||||||
$sql = $this->builder->delete();
|
$sql = $this->builder->delete();
|
||||||
if ($getSql === FALSE) {
|
if ($getSql === FALSE) {
|
||||||
return (bool)$this->execute($sql)->delete();
|
return (bool)$this->execute($sql, $this->attributes)->delete();
|
||||||
}
|
}
|
||||||
return $sql;
|
return $sql;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user