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)
|
public function prepareResult($rows)
|
||||||
{
|
{
|
||||||
$result = [];
|
$result = [];
|
||||||
|
if (isset($rows[0]) && $rows[0] instanceof Document) {
|
||||||
if ($this->indexBy === null) {
|
if ($this->indexBy === null) {
|
||||||
foreach ($rows as $row) {
|
foreach ($rows as $row) {
|
||||||
$result[] = $row->getAll();
|
$result[] = $row->getAll();
|
||||||
|
@ -810,6 +811,9 @@ class Query extends Component implements QueryInterface
|
||||||
$result[$key] = $row->getAll();
|
$result[$key] = $row->getAll();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
$result = $rows;
|
||||||
|
}
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue