[API] Fixes issue where nullable vars was first

这个提交包含在:
Peter Goodhall 2023-03-29 15:02:36 +01:00
父节点 9f94f99f46
当前提交 d02375fba6
共有 2 个文件被更改,包括 6 次插入5 次删除

查看文件

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

查看文件

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