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);