Skip to content

Commit

Permalink
feat: update #toilet.update.guangzhou: add main station name redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
BobLiu0518 committed Dec 31, 2024
1 parent e052d09 commit 86a57dd
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions module/toilet/update/guangzhou.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,14 @@
$toiletInfo[$company][$stationName] = ['toilets' => $toilets[$row['station_id']] ?? []];
}

foreach(['guangzhou', 'foshan', 'guangdong'] as $company) {
foreach($toiletInfo[$company] as $station => $data) {
if(preg_match('/^(.+)((.+))$/u', $station, $matches) && $matches[2] != '有轨') {
$toiletInfo[$company][$matches[1]] = ['redirect' => [$station]];
}
}
}

// Handle tram redirect
$toiletInfo['guangzhou']['广州塔']['redirect'] = ['广州塔(有轨)'];
$toiletInfo['foshan']['林岳东']['redirect'] = ['林岳东(有轨)'];
Expand Down

0 comments on commit 86a57dd

Please sign in to comment.