Resolves issue 1632. JSON-Array of stations will be returned if /index.php/api/station_info/[key] is called

This commit is contained in:
int2001
2023-07-05 14:16:53 +00:00
parent 646bf737e0
commit f938270f4c
2 changed files with 29 additions and 2 deletions

View File

@@ -23,9 +23,12 @@ class Stations extends CI_Model {
return $this->db->get();
}
function all_of_user() {
function all_of_user($userid = null) {
if ($userid == null) {
$userid=$this->session->userdata('user_id'); // Fallback to session-uid, if userid is omitted
}
$this->db->select('station_profile.*, dxcc_entities.name as station_country, dxcc_entities.end as dxcc_end');
$this->db->where('user_id', $this->session->userdata('user_id'));
$this->db->where('user_id', $userid);
$this->db->join('dxcc_entities','station_profile.station_dxcc = dxcc_entities.adif','left outer');
return $this->db->get('station_profile');
}