From 4089e6e3e8a9c2258e92d2dbb58b2ca1afc79535 Mon Sep 17 00:00:00 2001 From: int2001 Date: Fri, 29 Dec 2023 08:23:36 +0000 Subject: [PATCH] Take care of LINKED-Profiles when counting last QSOs --- application/models/Logbook_model.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index 1ac35376..b586d81c 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -1348,15 +1348,16 @@ class Logbook_model extends CI_Model { } function times_worked($callsign) { + $logbooks_locations_array = $this->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); $this->db->select('count(1) as TWKED'); $this->db->join('station_profile', 'station_profile.station_id = '.$this->config->item('table_name').'.station_id'); $this->db->group_start(); $this->db->where($this->config->item('table_name').'.COL_CALL', $callsign); $this->db->or_like($this->config->item('table_name').'.COL_CALL', '/'.$callsign,'before'); - $this->db->or_like($this->config->item('table_name').'.COL_CALL', $callsign.'/','after'); - $this->db->or_like($this->config->item('table_name').'.COL_CALL', '/'.$callsign.'/'); + $this->db->or_like($this->config->item('table_name').'.COL_CALL', $callsign.'/','after'); $this->db->or_like($this->config->item('table_name').'.COL_CALL', '/'.$callsign.'/'); $this->db->group_end(); $this->db->where('station_profile.user_id', $this->session->userdata('user_id')); + $this->db->where_in('station_profile.station_id', $logbooks_locations_array); $this->db->limit(1); $query = $this->db->get($this->config->item('table_name')); $name = "";