filter out NULL lat/lng values from Geographical Map display queries (#12985)

* filter out null lat/long values from map display queries

* removed space

* and the 2nd one

Co-authored-by: PipoCanaja <38363551+PipoCanaja@users.noreply.github.com>
This commit is contained in:
rhinoau
2021-06-25 07:33:20 +08:00
committed by GitHub
parent ce0ab24acd
commit 450463f7b1

View File

@@ -84,6 +84,7 @@ var greenMarker = L.AwesomeMarkers.icon({
$sql = "SELECT DISTINCT(`device_id`),`location`,`sysName`,`hostname`,`os`,`status`,`lat`,`lng` FROM `devices`
LEFT JOIN `locations` ON `devices`.`location_id`=`locations`.`id`
WHERE `disabled`=0 AND `ignore`=0 AND ((`lat` != '' AND `lng` != '') OR (`location` REGEXP '\[[0-9\.\, ]+\]'))
AND (`lat` IS NOT NULL AND `lng` IS NOT NULL)
AND `status` IN " . dbGenPlaceholders(count($show_status)) .
' ORDER BY `status` ASC, `hostname`';
$param = $show_status;
@@ -95,6 +96,7 @@ var greenMarker = L.AwesomeMarkers.icon({
FROM `devices`
LEFT JOIN `locations` ON `devices`.location_id=`locations`.`id`
WHERE `disabled`=0 AND `ignore`=0 AND ((`lat` != '' AND `lng` != '') OR (`location` REGEXP '\[[0-9\.\, ]+\]'))
AND (`lat` IS NOT NULL AND `lng` IS NOT NULL)
AND `devices`.`device_id` IN " . dbGenPlaceholders(count($device_ids)) .
' AND `status` IN ' . dbGenPlaceholders(count($show_status)) .
' ORDER BY `status` ASC, `hostname`';