Skip to content

Commit 7855c9e

Browse files
committed
Fixed behavior of RunnableSelect::fetchGroups
1 parent a2a2bd0 commit 7855c9e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Builder/RunnableSelect.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,12 @@ public function fetchGroups(array $fields) {
116116
$tmp = &$result;
117117
foreach($fields as $field) {
118118
$value = $row[$field];
119-
$tmp[$value] = [];
119+
if(!array_key_exists($value, $tmp)) {
120+
$tmp[$value] = [];
121+
}
120122
$tmp = &$tmp[$value];
121123
}
122-
$tmp = $row;
124+
$tmp[] = $row;
123125
}
124126
return $result;
125127
}

0 commit comments

Comments
 (0)