Skip to content

Commit c8ae06f

Browse files
author
Gabriel Tadra Mainginski
committed
More improvements.
1 parent c9ccd06 commit c8ae06f

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

Database/SybaseConnection.php

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,13 +144,17 @@ private function compileBindings($query, $bindings)
144144
$arrTables = $arrTables[1];
145145

146146
$ind = 0;
147-
if(count($arrTables) == 1){
147+
$numTables = count($arrTables);
148+
149+
if($numTables == 1){
148150
$table = $arrTables[0];
149151
}
150-
152+
151153
foreach($arrQuery as $key=>$campos){
152-
if(in_array($campos, $arrTables) || (count($arrTables) == 1 && isset($table) && $key == 0)){
153-
if(count($arrTables) > 1){
154+
$itsTable = in_array($campos, $arrTables);
155+
156+
if($itsTable || ($numTables == 1 && isset($table) && $key == 0)){
157+
if($numTables > 1){
154158
$table = $campos;
155159
}
156160
if(!array_key_exists($table, $new_format)){
@@ -164,7 +168,7 @@ private function compileBindings($query, $bindings)
164168
}
165169
}
166170

167-
if(!in_array($campos, $arrTables)){
171+
if(!$itsTable){
168172
if(count($bindings)>$ind){
169173
array_push($new_format[$table], ['campo' => $campos, 'binding' => $ind]);
170174
if(in_array(strtolower($types[$table][$campos]['type']), $this->without_quotes)){

0 commit comments

Comments
 (0)