diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index 479dc1f5..eb1fa4b4 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -2344,15 +2344,14 @@ class Logbook_model extends CI_Model { $this->db->select('station_profile.*, '.$this->config->item('table_name').'.COL_PRIMARY_KEY, '.$this->config->item('table_name').'.COL_TIME_ON, '.$this->config->item('table_name').'.COL_CALL, '.$this->config->item('table_name').'.COL_MODE, '.$this->config->item('table_name').'.COL_SUBMODE, '.$this->config->item('table_name').'.COL_BAND, '.$this->config->item('table_name').'.COL_COMMENT, '.$this->config->item('table_name').'.COL_RST_SENT, '.$this->config->item('table_name').'.COL_PROP_MODE, '.$this->config->item('table_name').'.COL_SAT_NAME, '.$this->config->item('table_name').'.COL_SAT_MODE, '.$this->config->item('table_name').'.COL_QSLMSG'); $this->db->from('station_profile'); $this->db->join($this->config->item('table_name'),'station_profile.station_id = '.$this->config->item('table_name').'.station_id'); - $this->db->group_start(); - $this->db->where('station_profile.eqslqthnickname !=', ''); - $this->db->or_where('station_profile.eqslqthnickname is not null'); - $this->db->group_end(); + $this->db->where("coalesce(station_profile.eqslqthnickname, '') <> ''"); $this->db->where($this->config->item('table_name').'.COL_CALL !=', ''); - $this->db->where($this->config->item('table_name').'.COL_EQSL_QSL_SENT !=', 'Y'); - $this->db->group_start(); - $this->db->where($this->config->item('table_name').'.COL_EQSL_QSL_SENT !=', 'I'); - $this->db->or_where(array($this->config->item('table_name').'.COL_EQSL_QSL_SENT' => NULL)); + $this->db->group_start(); + $this->db->where($this->config->item('table_name').'.COL_EQSL_QSL_SENT is null'); + $this->db->or_where($this->config->item('table_name').'.COL_EQSL_QSL_SENT', ''); + $this->db->or_where($this->config->item('table_name').'.COL_EQSL_QSL_SENT', 'R'); + $this->db->or_where($this->config->item('table_name').'.COL_EQSL_QSL_SENT', 'Q'); + $this->db->or_where($this->config->item('table_name').'.COL_EQSL_QSL_SENT', 'N'); $this->db->group_end(); return $this->db->get();