改进Query类的chunk方法对主键的获取

This commit is contained in:
thinkphp
2016-08-17 16:07:05 +08:00
parent 40582d4012
commit 65053bc1a5

View File

@@ -2045,7 +2045,7 @@ class Query
public function chunk($count, $callback, $column = null)
{
$options = $this->getOptions();
$column = $column ?: $this->getPk();
$column = $column ?: $this->getPk(isset($options['table']) ? $options['table'] : '');
$bind = $this->bind;
$resultSet = $this->limit($count)->order($column, 'asc')->select();