You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Database/SybaseConnection.php
+21-17Lines changed: 21 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -99,35 +99,46 @@ private function compileForSelect(Builder $builder, $bindings) {
99
99
if(count($bindings)==0){
100
100
return [];
101
101
}
102
-
103
102
$bindings = $this->prepareBindings($bindings);
104
-
105
103
106
104
$arrTables = [];
107
105
array_push($arrTables, $builder->from);
108
-
//var_dump($builder);
106
+
109
107
if(!empty($builder->joins)){
110
108
foreach($builder->joinsas$join){
109
+
111
110
array_push($arrTables, $join->table);
112
111
}
113
112
}
114
113
$new_format = [];
115
114
foreach($arrTablesas$tables){
116
-
117
-
$queryRes = $this->getPdo()->query("select a.name, b.name AS type FROM syscolumns a noholdlock JOIN systypes b noholdlock ON a.usertype = b.usertype and object_name(a.id) = '".$tables."'");
preg_match("/(?:(?'table'.*)(?: as )(?'alias'.*))|(?'tables'.*)/", $tables, $alias);
116
+
if(empty($alias['alias'])){
117
+
$tables = $alias['tables'];
118
+
}else{
119
+
$tables = $alias['table'];
120
+
}
119
121
122
+
$queryRes = $this->getPdo()->query("select a.name, b.name AS type FROM syscolumns a noholdlock JOIN systypes b noholdlock ON a.usertype = b.usertype and object_name(a.id) = '".$tables."'");
0 commit comments