Ignore candidates from divisions outside Victoria.

This commit is contained in:
Kim Taylor
2025-04-19 15:47:49 +10:00
parent babf8f81b6
commit 2cf3d0bd26
2 changed files with 11 additions and 1 deletions

View File

@@ -46,6 +46,7 @@ function match_lga(&$candidate_data, $lga_list) {
foreach ($candidate_data as &$candidate) {
/* Match user typed LGA/Ward to our database */
$max_score = 0;
$match_lga = null;
foreach ($lga_list as $lga) {
$aa = preg_split("/[^a-z]/", strtolower($candidate['Division']));
$bb = preg_split("/[^a-z]/", $lga['slug']);
@@ -76,7 +77,11 @@ function match_lga(&$candidate_data, $lga_list) {
}
*/
$candidate['match_division'] = $match_lga['slug'];
if ($match_lga === null) {
$candidate['match_division'] = "no_match";
} else {
$candidate['match_division'] = $match_lga['slug'];
}
//$candidate['match_ward'] = $match_ward;
}
}