From 365e79c3849ac2560c9dc06829ef54bd29fdd68f Mon Sep 17 00:00:00 2001 From: Andreas <6977712+AndreasK79@users.noreply.github.com> Date: Thu, 9 Sep 2021 22:35:25 +0200 Subject: [PATCH] [SOTA Award] Updated code to support station logbooks --- application/models/Sota.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/application/models/Sota.php b/application/models/Sota.php index 9cb885de..6d82f369 100644 --- a/application/models/Sota.php +++ b/application/models/Sota.php @@ -6,18 +6,18 @@ class Sota extends CI_Model { { parent::__construct(); } - + function get_all() { $CI =& get_instance(); - $CI->load->model('Stations'); - $station_id = $CI->Stations->find_active(); + $CI->load->model('logbooks_model'); + $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); - $this->db->where("station_id", $station_id); - $this->db->order_by("COL_SOTA_REF", "ASC"); + $this->db->where_in("station_id", $logbooks_locations_array); + $this->db->order_by("COL_SOTA_REF", "ASC"); $this->db->where('COL_SOTA_REF !=', ''); - + return $this->db->get($this->config->item('table_name')); } } -?> \ No newline at end of file +?>