From eacabceec02d3662f56743c36eec3541f87ffbff Mon Sep 17 00:00:00 2001 From: Kim - DG9VH Date: Fri, 26 Jun 2020 14:05:42 +0200 Subject: [PATCH] Correcting QSL-count-behavior There was a bug in counting QSL-cards send, received and requested (by request or queue) for printing... Looked like a c&p-bug, now corrected. --- application/models/Logbook_model.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index cf8e6f08..83b43397 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -1145,7 +1145,7 @@ class Logbook_model extends CI_Model { $CI->load->model('Stations'); $station_id = $CI->Stations->find_active(); - $query = $this->db->query('SELECT DISTINCT (COL_QSL_SENT) AS band, count(COL_QSL_SENT) AS count FROM '.$this->config->item('table_name').' WHERE station_id = '.$station_id.' AND COL_QSL_SENT = "Y" GROUP BY band'); + $query = $this->db->query('SELECT count(COL_QSL_SENT) AS count FROM '.$this->config->item('table_name').' WHERE station_id = '.$station_id.' AND COL_QSL_SENT = "Y"'); $row = $query->row(); @@ -1163,7 +1163,7 @@ class Logbook_model extends CI_Model { $CI->load->model('Stations'); $station_id = $CI->Stations->find_active(); - $query = $this->db->query('SELECT DISTINCT (COL_QSL_SENT) AS band, count(COL_QSL_SENT) AS count FROM '.$this->config->item('table_name').' WHERE station_id = '.$station_id.' AND COL_QSL_SENT in ("Q", "R") GROUP BY band'); + $query = $this->db->query('SELECT count(COL_QSL_SENT) AS count FROM '.$this->config->item('table_name').' WHERE station_id = '.$station_id.' AND COL_QSL_SENT in ("Q", "R")'); $row = $query->row(); @@ -1181,7 +1181,7 @@ class Logbook_model extends CI_Model { $CI->load->model('Stations'); $station_id = $CI->Stations->find_active(); - $query = $this->db->query('SELECT DISTINCT (COL_QSL_RCVD) AS band, count(COL_QSL_RCVD) AS count FROM '.$this->config->item('table_name').' WHERE station_id = '.$station_id.' AND COL_QSL_RCVD = "Y" GROUP BY band'); + $query = $this->db->query('SELECT count(COL_QSL_RCVD) AS count FROM '.$this->config->item('table_name').' WHERE station_id = '.$station_id.' AND COL_QSL_RCVD = "Y"'); $row = $query->row();