From 53c6d623c41e24252f4f8a33609e30f6e052b810 Mon Sep 17 00:00:00 2001 From: int2001 Date: Tue, 10 Sep 2024 08:20:01 +0000 Subject: [PATCH] Fixed bug --- application/controllers/Lotw.php | 2 +- application/models/Lotw_model.php | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/application/controllers/Lotw.php b/application/controllers/Lotw.php index 2c9506de2..9aa8b5f21 100644 --- a/application/controllers/Lotw.php +++ b/application/controllers/Lotw.php @@ -213,7 +213,7 @@ class Lotw extends CI_Controller { // Get Certificate Data $this->load->model('Lotw_model'); $data['station_profile'] = $station_profile; - $data['lotw_cert_info'] = $this->Lotw_model->find_cert($station_profile->station_callsign, $station_profile->station_dxcc, $station_profile->user_id); + $data['lotw_cert_info'] = $this->Lotw_model->lotw_cert_details($station_profile->station_callsign, $station_profile->station_dxcc, $station_profile->user_id); // If Station Profile has no LoTW Cert continue on. if(!isset($data['lotw_cert_info']->cert_dxcc_id)) { diff --git a/application/models/Lotw_model.php b/application/models/Lotw_model.php index 0cfade27e..695edde9f 100644 --- a/application/models/Lotw_model.php +++ b/application/models/Lotw_model.php @@ -21,6 +21,16 @@ class Lotw_model extends CI_Model { return $query; } + + function lotw_cert_details($callsign, $dxcc, $user_id) { + $this->db->where('cert_dxcc_id', $dxcc); + $this->db->where('user_id', $user_id); + $this->db->where('callsign', $callsign); + $query = $this->db->get('lotw_certs'); + + return $query->row(); + } + function find_cert($callsign, $dxcc, $user_id) { $this->db->where('user_id', $user_id); $this->db->where('cert_dxcc_id', $dxcc);