Skip to content

Commit 291afcc

Browse files
committed
修复bug
1 parent 974065c commit 291afcc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ShardingQuery.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,12 +176,12 @@ public function select()
176176
$sql = $this->sql();
177177
$data = [];
178178
foreach ($range as $tableName => $item) {
179-
$sql = str_replace('{table}', $tableName, $sql);
180-
$sql = "{$sql} LIMIT {$item['limit']} OFFSET {$item['offset']}";
181-
$result = call_user_func($this->callback, $sql);
179+
$tmpSql = str_replace('{table}', $tableName, $sql);
180+
$tmpSql = "{$tmpSql} LIMIT {$item['limit']} OFFSET {$item['offset']}";
181+
$result = call_user_func($this->callback, $tmpSql);
182182
$data = array_merge($data, $result);
183183
$this->trace[] = [
184-
'sql' => $sql,
184+
'sql' => $tmpSql,
185185
'rowCount' => count($result),
186186
];
187187
}

0 commit comments

Comments
 (0)