From 952f6080a6c0bb2bc0814a139b1fb48bd7ab19c1 Mon Sep 17 00:00:00 2001 From: Andreas <6977712+AndreasK79@users.noreply.github.com> Date: Sun, 16 Jan 2022 17:44:53 +0100 Subject: [PATCH] [Distances Worked] Bugfix for two locations, where one didn't have any QSOs on selected band. --- application/models/Distances_model.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/application/models/Distances_model.php b/application/models/Distances_model.php index 35da1edb..0f2f1ead 100644 --- a/application/models/Distances_model.php +++ b/application/models/Distances_model.php @@ -37,12 +37,16 @@ class Distances_model extends CI_Model else { $this->db->where('col_band', $postdata['band']); } + $this->db->where('station_id', $station_id); - $dataarrayata = $this->db->get($this->config->item('table_name')); + $queryresult = $this->db->get($this->config->item('table_name')); - $temp = $this->plot($dataarrayata->result_array(), $gridsquare, $measurement_base); + if ($queryresult->result_array()) { + $temp = $this->plot($queryresult->result_array(), $gridsquare, $measurement_base); + + $result = $this->mergeresult($result, $temp); + } - $result = $this->mergeresult($result, $temp); } }