From d00693b35fad30980a2fd17e6054dffa1f84860a Mon Sep 17 00:00:00 2001 From: HB9HIL Date: Sat, 14 Dec 2024 14:32:27 +0100 Subject: [PATCH] add station_id to query --- application/models/Qslprint_model.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/application/models/Qslprint_model.php b/application/models/Qslprint_model.php index 83012df6b..c982c0726 100644 --- a/application/models/Qslprint_model.php +++ b/application/models/Qslprint_model.php @@ -163,6 +163,9 @@ class Qslprint_model extends CI_Model { if (empty($qso_data)) { return []; } + + $this->load->model('stations'); + $station_ids = $this->stations->all_station_ids_of_user(); $where = []; $binding = []; @@ -177,6 +180,7 @@ class Qslprint_model extends CI_Model { $sql = "SELECT COL_CALL, COL_MODE, COL_BAND, COL_SAT_NAME, COUNT(COL_PRIMARY_KEY) AS count FROM " . $this->config->item('table_name') . " WHERE COL_QSL_SENT = 'Y' AND (" . implode(' OR ', $where) . ") + AND station_id IN (" . $station_ids . ") GROUP BY COL_CALL, COL_MODE, COL_BAND, COL_SAT_NAME ";