From b475f7d690f6961ab8c71ca1d2cc154055e5503b Mon Sep 17 00:00:00 2001 From: Ibrahim BinAlshikh Date: Mon, 4 Dec 2023 02:16:13 +0300 Subject: [PATCH] Update AbstractQuery.php --- webfiori/database/AbstractQuery.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/webfiori/database/AbstractQuery.php b/webfiori/database/AbstractQuery.php index 649522d..28ad320 100644 --- a/webfiori/database/AbstractQuery.php +++ b/webfiori/database/AbstractQuery.php @@ -633,7 +633,7 @@ public function on(string $leftCol, string $rightCol, $cond = '=', $joinWith = ' $table->getLeft()->addColumns([ $leftCol => ['type' => 'varchar'] ]); - $leftColObj = $table->getColByKey($leftCol); + $leftColObj = $table->getLeft()->getColByKey($leftCol); } $leftColObj->setWithTablePrefix(false); @@ -649,7 +649,7 @@ public function on(string $leftCol, string $rightCol, $cond = '=', $joinWith = ' $table->getRight()->addColumns([ $rightCol => ['type' => 'varchar'] ]); - $rightColObj = $table->getColByKey($rightCol); + $rightColObj = $table->getRight()->getColByKey($rightCol); } $rightColObj->setWithTablePrefix(false); $rightColName = $rightColObj->getOwner()->getName().'.'.$rightColObj->getOldName(); @@ -1011,7 +1011,7 @@ public function table($tblName) { } $this->getSchema()->addTable($tableObj); $this->prevQueryObj = $this->copyQuery(); - $this->resetBinding(); + $this->prevQueryObj->resetBinding(); if (strlen($this->query) != 0) { $this->setQuery($this->getQuery()); @@ -1054,9 +1054,6 @@ public function union(AbstractQuery $query, $all = false) { $uAll = $all === true; $unionStm = $uAll ? "\nunion all\n" : "\nunion\n"; $this->setQuery($queries[$count - 2]['query'].$unionStm.$query->getQuery()); - - $this->setBindings($query->getBindings(), 'first'); - $whereExpr = $query->getTable()->getSelect()->getWhereExpr(); if ($whereExpr !== null) { $whereExpr->setValue('');