diff --git a/application/controllers/Api.php b/application/controllers/Api.php index 223fc031..51d78c16 100644 --- a/application/controllers/Api.php +++ b/application/controllers/Api.php @@ -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) diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index 9c715b6d..05725722 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -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'));