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

This commit is contained in:
thinkphp
2016-08-09 11:14:24 +08:00
parent 4685af2f55
commit 1a089223ea

View File

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