From e4092897678994e85147a4c448af047800d49d36 Mon Sep 17 00:00:00 2001 From: Railken Date: Fri, 5 Apr 2024 00:38:55 +0200 Subject: [PATCH] fix bug query builder / eloquent builder grammar --- src/Query/Visitors/BaseOperatorVisitor.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Query/Visitors/BaseOperatorVisitor.php b/src/Query/Visitors/BaseOperatorVisitor.php index 71ae659..317ce3a 100644 --- a/src/Query/Visitors/BaseOperatorVisitor.php +++ b/src/Query/Visitors/BaseOperatorVisitor.php @@ -84,7 +84,8 @@ public function parseNode($query, $node) $childs = $childs->map(function ($v) use ($query) { if ($v instanceof \Illuminate\Database\Query\Expression) { - return $v->getValue($query->grammar); + $qb = $query instanceof \Illuminate\Database\Query\Builder ? $query : $query->getQuery(); + return $v->getValue($qb->grammar); } $query->addBinding($v, 'where');