This commit is contained in:
2024-12-13 14:45:03 +08:00
parent 530104ceb6
commit db92238e9e
+3 -3
View File
@@ -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) . ')';
}