改进Query类的column方法

This commit is contained in:
thinkphp
2016-12-07 11:18:04 +08:00
parent 024f75c846
commit e0d23618b6

View File

@@ -469,6 +469,9 @@ class Query
$key1 = array_shift($fields);
$key2 = $fields ? array_shift($fields) : '';
$key = $key ?: $key1;
if (strpos($key, '.')) {
list($alias, $key) = explode('.', $key);
}
foreach ($resultSet as $val) {
if ($count > 2) {
$result[$val[$key]] = $val;