改进Query类的chunk方法 支持参数绑定

This commit is contained in:
thinkphp
2016-06-01 08:34:04 +08:00
parent 6248dff43b
commit 431c5d1a28

View File

@@ -1720,6 +1720,7 @@ class Query
{
$column = $column ?: $this->getPk();
$options = $this->getOptions();
$bind = $this->bind;
$resultSet = $this->limit($count)->order($column, 'asc')->select();
while (!empty($resultSet)) {
@@ -1730,6 +1731,7 @@ class Query
$lastId = is_array($end) ? $end[$column] : $end->$column;
$resultSet = $this->options($options)
->limit($count)
->bind($bind)
->where($column, '>', $lastId)
->order($column, 'asc')
->select();