Ignore candidates from divisions outside Victoria.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user