Skip to content

Commit eb800bb

Browse files
authored
🐛 Correctly sort stations in mapping process (#3425)
1 parent 9e86541 commit eb800bb

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

app/DataProviders/Repositories/StationRepository.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,11 @@ public function createMotisStation(mixed $rawStation, DataProvider $source): Sta
134134
$stations = $stations->filter(function($station) {
135135
return $station->motisRepositoryTempPercent > 90;
136136
});
137-
$stations = $stations->sortBy('ibnr', SORT_ASC);
138-
$stations = $stations->sortBy('motisRepositoryTempPercent', SORT_ASC);
137+
$stations = $stations->sortBy([
138+
['ibnr', 'desc'],
139+
['relevance', 'desc'],
140+
['motisRepositoryTempPercent', 'desc']
141+
]);
139142

140143
if ($stations->isEmpty()) {
141144
$station = new Station([

0 commit comments

Comments
 (0)