query prepareResult return one column
This commit is contained in:
parent
1f23259b58
commit
acaf1780bc
|
@ -796,6 +796,7 @@ class Query extends Component implements QueryInterface
|
|||
public function prepareResult($rows)
|
||||
{
|
||||
$result = [];
|
||||
if (isset($rows[0]) && $rows[0] instanceof Document) {
|
||||
if ($this->indexBy === null) {
|
||||
foreach ($rows as $row) {
|
||||
$result[] = $row->getAll();
|
||||
|
@ -810,6 +811,9 @@ class Query extends Component implements QueryInterface
|
|||
$result[$key] = $row->getAll();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$result = $rows;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue