Skip to content

Commit 3621f4c

Browse files
apply qualifyColumn for groupBy column
1 parent e0b0fe2 commit 3621f4c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Services/Search/RepositorySearchService.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ protected function applyGroupBy(RestifyRequest $request, Repository $repository,
225225
return $query;
226226
}
227227

228+
$model = $query->getModel();
228229
$groupByColumns = explode(',', $request->input('group_by'));
229230

230231
foreach ($groupByColumns as $column) {
@@ -235,7 +236,7 @@ protected function applyGroupBy(RestifyRequest $request, Repository $repository,
235236
implode(', ', $repository::$groupBy)
236237
));
237238
}
238-
$query->groupBy($column);
239+
$query->groupBy($model->qualifyColumn($column));
239240
}
240241

241242
return $query;

0 commit comments

Comments
 (0)