@@ -136,15 +136,14 @@ private function compileForSelect(Builder $builder, $bindings) {
136136 $ wheres = [];
137137 foreach ($ builder ->wheres as $ w ){
138138 switch ($ w ['type ' ]){
139- case " Basic " :
139+ default :
140140 array_push ($ wheres , $ w );
141141 break ;
142142 case "Nested " :
143143 $ wheres += $ w ['query ' ]->wheres ;
144144 break ;
145145 }
146146 }
147- var_dump ($ wheres );
148147 $ i = 0 ;
149148 for ($ ind = 0 ; $ ind < count ($ wheres ); $ ind ++ ){
150149 if (isset ($ wheres [$ ind ]['value ' ])){
@@ -351,7 +350,6 @@ public function compileOffset($offset, $query, $bindings = array(), $me){
351350 $ res_primaries = $ identity ->column .'+0 AS ' .$ identity ->column ;
352351 $ where_primaries = "#tmpPaginate. " .$ identity ->column .' = #tmpTable. ' .$ identity ->column ;
353352 }
354-
355353 //Offset operation
356354 $ this ->getPdo ()->query (str_replace (" from " , " into #tmpPaginate from " , $ this ->compileNewQuery ($ query , $ bindings )));
357355 $ this ->getPdo ()->query ("SELECT " .$ res_primaries .", idTmp=identity(18) INTO #tmpTable FROM #tmpPaginate " );
@@ -373,13 +371,11 @@ public function select($query, $bindings = array(), $useReadPdo = true)
373371 return $ this ->run ($ query , $ bindings , function ($ me , $ query , $ bindings ) use ($ useReadPdo )
374372 {
375373 if ($ me ->pretending ()) return array ();
376-
377374 if ($ this ->queryGrammar ->getBuilder () != NULL ){
378375 $ offset = $ this ->queryGrammar ->getBuilder ()->offset ;
379376 }else {
380377 $ offset = 0 ;
381378 }
382-
383379 if ($ offset >0 ){
384380 return $ this ->compileOffset ($ offset , $ query , $ bindings , $ me );
385381 }else {
@@ -414,4 +410,4 @@ public function affectingStatement($query, $bindings = array())
414410 return $ this ->getPdo ()->query ($ this ->compileNewQuery ($ query , $ bindings ))->rowCount ();
415411 });
416412 }
417- }
413+ }
0 commit comments