Cleaned up some code and filtered out sat qso when band not like SAT.

这个提交包含在:
AndreasK79 2020-03-18 19:26:26 +01:00
父节点 01588e6e64
当前提交 ead4e960de
共有 2 个文件被更改,包括 8 次插入14 次删除

查看文件

@ -29,7 +29,6 @@ class IOTA extends CI_Model {
{ {
// Call the Model constructor // Call the Model constructor
parent::__construct(); parent::__construct();
} }
function get_worked_bands() { function get_worked_bands() {
@ -54,7 +53,6 @@ class IOTA extends CI_Model {
array_push($worked_slots, strtoupper($row->COL_PROP_MODE)); array_push($worked_slots, strtoupper($row->COL_PROP_MODE));
} }
// bring worked-slots in order of defined $bandslots // bring worked-slots in order of defined $bandslots
$results = array(); $results = array();
foreach(array_keys($this->bandslots) as $slot) { foreach(array_keys($this->bandslots) as $slot) {
@ -70,11 +68,10 @@ class IOTA extends CI_Model {
$CI->load->model('Stations'); $CI->load->model('Stations');
$station_id = $CI->Stations->find_active(); $station_id = $CI->Stations->find_active();
foreach ($bands as $band) { // Looping through bands and entities to generate the array needed for display foreach ($bands as $band) { // Looping through bands and iota to generate the array needed for display
foreach ($iotaArray as $iota) { foreach ($iotaArray as $iota) {
$iotaMatrix[$iota->tag]['prefix'] = $iota->prefix; $iotaMatrix[$iota->tag]['prefix'] = $iota->prefix;
$iotaMatrix[$iota->tag]['name'] = $iota->name; $iotaMatrix[$iota->tag]['name'] = $iota->name;
//$iotaMatrix[$iota->tag]['status'] = $iota->status;
if ($postdata['includedeleted']) if ($postdata['includedeleted'])
$iotaMatrix[$iota->tag]['Deleted'] = isset($iota->status) && $iota->status == 'D' ? "<div class='alert-danger'>Y</div>" : ''; $iotaMatrix[$iota->tag]['Deleted'] = isset($iota->status) && $iota->status == 'D' ? "<div class='alert-danger'>Y</div>" : '';
$iotaMatrix[$iota->tag][$band] = '-'; $iotaMatrix[$iota->tag][$band] = '-';
@ -136,6 +133,7 @@ class IOTA extends CI_Model {
$sql .= " and col_prop_mode ='" . $band . "'"; $sql .= " and col_prop_mode ='" . $band . "'";
} }
else { else {
$sql .= " and col_prop_mode !='SAT'";
$sql .= " and col_band ='" . $band . "'"; $sql .= " and col_band ='" . $band . "'";
} }
@ -143,10 +141,6 @@ class IOTA extends CI_Model {
$sql .= " and coalesce(iota.status, '') <> 'D'"; $sql .= " and coalesce(iota.status, '') <> 'D'";
} }
if ($postdata['includedeleted'] == NULL) {
$sql .= " and coalesce(iota.status, '') <> 'D'";
}
$sql .= $this->addContinentsToQuery($postdata); $sql .= $this->addContinentsToQuery($postdata);
$query = $this->db->query($sql); $query = $this->db->query($sql);
@ -164,6 +158,7 @@ class IOTA extends CI_Model {
$sql .= " and col_prop_mode ='" . $band . "'"; $sql .= " and col_prop_mode ='" . $band . "'";
} }
else { else {
$sql .= " and col_prop_mode !='SAT'";
$sql .= " and col_band ='" . $band . "'"; $sql .= " and col_band ='" . $band . "'";
} }
@ -198,6 +193,7 @@ class IOTA extends CI_Model {
$sql .= " and col_prop_mode ='" . $postdata['band'] . "'"; $sql .= " and col_prop_mode ='" . $postdata['band'] . "'";
} }
else { else {
$sql .= " and col_prop_mode !='SAT'";
$sql .= " and col_band ='" . $postdata['band'] . "'"; $sql .= " and col_band ='" . $postdata['band'] . "'";
} }
} }
@ -223,6 +219,7 @@ class IOTA extends CI_Model {
$sql .= " and col_prop_mode ='" . $postdata['band'] . "'"; $sql .= " and col_prop_mode ='" . $postdata['band'] . "'";
} }
else { else {
$sql .= " and col_prop_mode !='SAT'";
$sql .= " and col_band ='" . $postdata['band'] . "'"; $sql .= " and col_band ='" . $postdata['band'] . "'";
} }
} }
@ -234,6 +231,7 @@ class IOTA extends CI_Model {
$sql .= " and col_prop_mode ='" . $postdata['band'] . "'"; $sql .= " and col_prop_mode ='" . $postdata['band'] . "'";
} }
else { else {
$sql .= " and col_prop_mode !='SAT'";
$sql .= " and col_band ='" . $postdata['band'] . "'"; $sql .= " and col_band ='" . $postdata['band'] . "'";
} }
} }
@ -267,16 +265,11 @@ class IOTA extends CI_Model {
$sql .= " and col_prop_mode ='" . $postdata['band'] . "'"; $sql .= " and col_prop_mode ='" . $postdata['band'] . "'";
} }
else { else {
$sql .= " and col_prop_mode !='SAT'";
$sql .= " and col_band ='" . $postdata['band'] . "'"; $sql .= " and col_band ='" . $postdata['band'] . "'";
} }
} }
if ($postdata['includedeleted'] == NULL) {
$sql .= " and coalesce(iota.status, '') <> 'D'";
}
$sql .= $this->addContinentsToQuery($postdata);
$query = $this->db->query($sql); $query = $this->db->query($sql);
return $query->result(); return $query->result();

查看文件

@ -198,6 +198,7 @@ class Logbook_model extends CI_Model {
$this->db->where('station_id', $station_id); $this->db->where('station_id', $station_id);
$this->db->where('COL_IOTA', $iota); $this->db->where('COL_IOTA', $iota);
if($band != "SAT") { if($band != "SAT") {
$this->db->where('COL_BAND !=', 'SAT');
$this->db->where('COL_BAND', $band); $this->db->where('COL_BAND', $band);
} else { } else {
$this->db->where('COL_PROP_MODE', "SAT"); $this->db->where('COL_PROP_MODE', "SAT");