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
$indentity = $this->getPdo()->query("select name as 'column' from syscolumns where status & 128 = 128 AND object_name(id)='".$from."'")->fetchAll($me->getFetchMode())[0];
277
+
278
+
if(count($indentity) == 0){
279
+
$primaries = $this->getPdo()->query("SELECT index_col(object_name(i.id), i.indid, c.colid) AS primary_key FROM sysindexes i, syscolumns c WHERE i.id = c.id AND c.colid <= i.keycnt AND i.id = object_id('".$from."')")->fetchAll($me->getFetchMode());
280
+
foreach($primariesas$primary)
281
+
{
282
+
$new_arr[] = $primary->primary_key.'+0 AS '.$primary->primary_key;
$this->getPdo()->query(str_replace(" from ", " into #tmpPaginate from ", $this->compileNewQuery($query, $bindings)));
287
-
$this->getPdo()->query("SELECT ".$res_primarys.", idTmp=identity(18) INTO #tmpTable FROM #tmpPaginate");
288
-
return$this->getPdo()->query("SELECT #tmpPaginate.*, #tmpTable.idTmp FROM #tmpTable INNER JOIN #tmpPaginate ON ".$where_primarys." WHERE #tmpTable.idTmp "
294
+
$this->getPdo()->query("SELECT ".$res_primaries.", idTmp=identity(18) INTO #tmpTable FROM #tmpPaginate");
295
+
return$this->getPdo()->query("SELECT #tmpPaginate.*, #tmpTable.idTmp FROM #tmpTable INNER JOIN #tmpPaginate ON ".$where_primaries." WHERE #tmpTable.idTmp "
289
296
. "BETWEEN ".($offset+1) ." AND ". ($offset+$limit)
290
297
." ORDER BY #tmpTable.idTmp ASC")->fetchAll($me->getFetchMode());
0 commit comments