[API] Fixes issue where nullable vars was first

pull/2054/head
Peter Goodhall 2023-03-29 15:02:36 +01:00
rodzic 9f94f99f46
commit d02375fba6
2 zmienionych plików z 6 dodań i 5 usunięć

Wyświetl plik

@ -524,7 +524,7 @@ class API extends CI_Controller {
// Search Logbook for callsign
$this->load->model('logbook_model');
$result = $this->logbook_model->check_if_callsign_worked_in_logbook($logbooks_locations_array, $callsign, $band);
$result = $this->logbook_model->check_if_callsign_worked_in_logbook($callsign, $logbooks_locations_array, $band);
http_response_code(201);
if($result > 0)
@ -597,7 +597,7 @@ class API extends CI_Controller {
// Search Logbook for callsign
$this->load->model('logbook_model');
$result = $this->logbook_model->check_if_grid_worked_in_logbook($logbooks_locations_array, $grid, $band);
$result = $this->logbook_model->check_if_grid_worked_in_logbook($grid, $logbooks_locations_array, $band);
http_response_code(201);
if($result > 0)

Wyświetl plik

@ -1389,7 +1389,7 @@ class Logbook_model extends CI_Model {
}
function check_if_callsign_worked_in_logbook($StationLocationsArray = null, $callsign, $band = null) {
function check_if_callsign_worked_in_logbook($callsign, $StationLocationsArray = null, $band = null) {
if($StationLocationsArray == null) {
$CI =& get_instance();
@ -1409,14 +1409,14 @@ class Logbook_model extends CI_Model {
// Where col_sat_name is not empty
$this->db->where('COL_SAT_NAME !=', '');
}
$this->db->limit('2');
$query = $this->db->get($this->config->item('table_name'));
return $query->num_rows();
}
function check_if_grid_worked_in_logbook($StationLocationsArray = null, $grid, $band = null) {
function check_if_grid_worked_in_logbook($grid, $StationLocationsArray = null, $band = null) {
if($StationLocationsArray == null) {
$CI =& get_instance();
@ -1436,6 +1436,7 @@ class Logbook_model extends CI_Model {
// Where col_sat_name is not empty
$this->db->where('COL_SAT_NAME !=', '');
}
$this->db->limit('2');
$query = $this->db->get($this->config->item('table_name'));