From db92238e9e640ecf06c3c5dd5f28378db91de94c Mon Sep 17 00:00:00 2001 From: whwyy Date: Fri, 13 Dec 2024 14:45:03 +0800 Subject: [PATCH] eee --- Traits/QueryTrait.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Traits/QueryTrait.php b/Traits/QueryTrait.php index e24beb3..1aecb86 100644 --- a/Traits/QueryTrait.php +++ b/Traits/QueryTrait.php @@ -80,10 +80,10 @@ abstract class QueryTrait extends Component implements ActiveQueryInterface, ISq * * @return $this */ - public function whereNotExists(Closure|string $callback, array $attributes = []): static + public function whereNotExists(Closure|Query $callback, array $attributes = []): static { - if (is_string($callback)) { - $this->where[] = $callback; + if ($callback instanceof Query) { + $this->where[] = 'NOT EXISTS(' . $callback->build() . ')'; } else { $this->where[] = 'NOT EXISTS(' . $this->makeClosureFunction($callback) . ')'; }