commit version 22.12.12447
This commit is contained in:
@ -6,15 +6,15 @@
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage update
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2022 Observium Limited
|
||||
*
|
||||
*/
|
||||
|
||||
$sql = "SELECT * FROM `devices_locations` WHERE 1";
|
||||
$sql .= generate_query_values(['Unknown', ''], 'location_country', '!=');
|
||||
$sql .= generate_query_values_and([ 'Unknown', '' ], 'location_country', '!=');
|
||||
$devices_locations = dbFetchRows($sql);
|
||||
|
||||
if (count($devices_locations))
|
||||
if (count((array)$devices_locations))
|
||||
{
|
||||
echo 'Unificate GEO Country names: ';
|
||||
|
||||
@ -24,8 +24,8 @@ if (count($devices_locations))
|
||||
$country = country_from_code($entry['location_country']);
|
||||
if ($country != $entry['location_country'])
|
||||
{
|
||||
$update_array = ['location_country' => $country,
|
||||
'location_updated' => $entry['location_updated']]; // Keep updated timestamp
|
||||
$update_array = [ 'location_country' => $country,
|
||||
'location_updated' => $entry['location_updated'] ]; // Keep updated timestamp
|
||||
dbUpdate($update_array, 'devices_locations', '`location_id` = ?', [$entry['location_id']]);
|
||||
echo('.');
|
||||
}
|
||||
|
Reference in New Issue
Block a user