Skip to content

Commit

Permalink
Update AbstractQuery.php
Browse files Browse the repository at this point in the history
  • Loading branch information
usernane committed Dec 3, 2023
1 parent 226f4b9 commit b475f7d
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions webfiori/database/AbstractQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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();
Expand Down Expand Up @@ -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());
Expand Down Expand Up @@ -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('');
Expand Down

0 comments on commit b475f7d

Please sign in to comment.