fix WAPC Award bands

This commit is contained in:
tallcode
2025-07-23 13:58:14 +08:00
parent 1fb485c69c
commit 580fec5b2d
3 changed files with 26 additions and 3 deletions

View File

@@ -187,7 +187,7 @@ class Awards extends CI_Controller {
$this->load->model('modes');
$this->load->model('bands');
$data['worked_bands'] = ['160m','80m','40m','30m','20m','17m','15m','12m','10m','6m','2m','70cm'];;
$data['worked_bands'] = $this->bands->get_worked_bands('wapc');
$data['modes'] = $this->modes->active();
if ($this->input->post('band') != NULL) { // Band is not set when page first loads.

View File

@@ -0,0 +1,23 @@
<?php
defined('BASEPATH') or exit('No direct script access allowed');
class Migration_add_wapc_bandxuser extends CI_Migration
{
public function up()
{
$fields = array(
'wapc TINYINT NOT NULL DEFAULT 1',
);
if (!$this->db->field_exists('wapc', 'bandxuser')) {
$this->dbforge->add_column('bandxuser', $fields);
}
}
public function down()
{
if ($this->db->field_exists('wapc', 'bandxuser')) {
$this->dbforge->drop_column('bandxuser', 'wapc');
}
}
}

View File

@@ -309,7 +309,7 @@ class WAPC extends CI_Model {
} else if ($band == 'All') {
$this->load->model('bands');
$bandslots = ['160m','80m','40m','30m','20m','17m','15m','12m','10m','6m','2m','70cm'];
$bandslots = $this->bands->get_worked_bands('wapc');
$bandslots_list = "'".implode("','",$bandslots)."'";
@@ -344,7 +344,7 @@ class WAPC extends CI_Model {
$bindings[]=$band;
} else if ($band == 'All') {
$this->load->model('bands');
$bandslots = ['160m','80m','40m','30m','20m','17m','15m','12m','10m','6m','2m','70cm'];
$bandslots = $this->bands->get_worked_bands('wapc');
$bandslots_list = "'".implode("','",$bandslots)."'";
$sql .= " and thcv.col_band in (" . $bandslots_list . ")";
$sql .= " and thcv.col_prop_mode !='SAT'";