Limit results to 500 and get rid of hard coded table name

pull/1398/head
phl0 2022-02-16 08:29:03 +01:00
rodzic 6432c7a6e6
commit af1451b542
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 48EA1E640798CA9A
2 zmienionych plików z 7 dodań i 6 usunięć

Wyświetl plik

@ -12,8 +12,8 @@ class Activated_grids_model extends CI_Model {
}
$sql = 'SELECT DISTINCT station_gridsquare AS SAT_SQUARE, COL_SAT_NAME FROM '
. 'station_profile JOIN TABLE_HRD_CONTACTS_V01 on TABLE_HRD_CONTACTS_V01.station_id = station_profile.station_id '
. 'WHERE station_profile.station_gridsquare != "" AND TABLE_HRD_CONTACTS_V01.COL_SAT_NAME != ""';
. 'station_profile JOIN '.$this->config->item('table_name').' on '.$this->config->item('table_name').'.station_id = station_profile.station_id '
. 'WHERE station_profile.station_gridsquare != "" AND '.$this->config->item('table_name').'.COL_SAT_NAME != ""';
return $this->db->query($sql);
}
@ -30,8 +30,8 @@ class Activated_grids_model extends CI_Model {
$location_list = "'".implode("','",$logbooks_locations_array)."'";
$sql = 'SELECT DISTINCT station_gridsquare AS SAT_SQUARE, COL_SAT_NAME FROM '
. 'station_profile JOIN TABLE_HRD_CONTACTS_V01 on TABLE_HRD_CONTACTS_V01.station_id = station_profile.station_id '
. 'WHERE station_profile.station_gridsquare != "" AND TABLE_HRD_CONTACTS_V01.COL_SAT_NAME != "" '
. 'station_profile JOIN '.$this->config->item('table_name').' on '.$this->config->item('table_name').'.station_id = station_profile.station_id '
. 'WHERE station_profile.station_gridsquare != "" AND '.$this->config->item('table_name').'.COL_SAT_NAME != "" '
. 'AND (COL_LOTW_QSL_SENT = "Y" OR COL_QSL_SENT = "Y");';
return $this->db->query($sql);
@ -49,7 +49,7 @@ class Activated_grids_model extends CI_Model {
$location_list = "'".implode("','",$logbooks_locations_array)."'";
$sql = 'SELECT DISTINCT station_gridsquare AS GRID_SQUARES, COL_BAND FROM '
. 'station_profile JOIN TABLE_HRD_CONTACTS_V01 on TABLE_HRD_CONTACTS_V01.station_id = station_profile.station_id '
. 'station_profile JOIN '.$this->config->item('table_name').' on '.$this->config->item('table_name').'.station_id = station_profile.station_id '
. 'WHERE station_profile.station_gridsquare != "" ';
if ($band != 'All') {
@ -76,7 +76,7 @@ class Activated_grids_model extends CI_Model {
$location_list = "'".implode("','",$logbooks_locations_array)."'";
$sql = 'SELECT DISTINCT station_gridsquare AS GRID_SQUARES, COL_BAND FROM '
. 'station_profile JOIN TABLE_HRD_CONTACTS_V01 on TABLE_HRD_CONTACTS_V01.station_id = station_profile.station_id '
. 'station_profile JOIN '.$this->config->item('table_name').' on '.$this->config->item('table_name').'.station_id = station_profile.station_id '
. 'WHERE station_profile.station_gridsquare != "" ';
if ($band != 'All') {

Wyświetl plik

@ -306,6 +306,7 @@ class Logbook_model extends CI_Model {
$this->db->where("(COL_MODE='" . $mode . "' OR COL_SUBMODE='" . $mode ."')");
}
$this->db->order_by("COL_TIME_ON", "desc");
$this->db->limit(500);
return $this->db->get($this->config->item('table_name'));
}