[eQSL] Adjusted query to filter out stations without nickname set (hopefully fixed all issues)

pull/2040/head
Andreas 2023-03-09 18:22:14 +01:00
rodzic bc8b7bf6b0
commit 363cda94bc
1 zmienionych plików z 7 dodań i 8 usunięć

Wyświetl plik

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