Merge pull request #1318 from AndreasK79/qrz_logbook_v2_fix

Qrz logbook v2 fix
这个提交包含在:
Peter Goodhall 2021-12-21 17:48:32 +00:00 提交者 GitHub
当前提交 cd8a38d717
找不到此签名对应的密钥
GPG 密钥 ID: 4AEE18F83AFDEB23
共有 3 个文件被更改,包括 9 次插入9 次删除

查看文件

@ -24,10 +24,9 @@ class Qrz extends CI_Controller {
$station_ids = $this->logbook_model->get_station_id_with_qrz_api();
if ($station_ids) {
foreach ($station_ids as $station_id) {
$result = $this->logbook_model->exists_qrz_api_key($station_id);
$qrz_api_key = $result->qrzapikey;
if($this->mass_upload_qsos($station_id, $qrz_api_key)) {
foreach ($station_ids as $station) {
$qrz_api_key = $station->qrzapikey;
if($this->mass_upload_qsos($station->station_id, $qrz_api_key)) {
echo "QSOs have been uploaded to QRZ.com.";
log_message('info', 'QSOs have been uploaded to QRZ.com.');
} else{
@ -108,7 +107,7 @@ class Qrz extends CI_Controller {
$data['page_title'] = "QRZ Logbook";
$data['station_profiles'] = $this->stations->all();
$data['station_profiles'] = $this->stations->all_of_user();
$data['station_profile'] = $this->stations->stations_with_qrz_api_key();
$this->load->view('interface_assets/header', $data);

查看文件

@ -383,7 +383,7 @@ class Logbook_model extends CI_Model {
*/
function exists_qrz_api_key($station_id) {
$sql = 'select qrzapikey, qrzrealtime from station_profile
where station_id = ' . $station_id;
where station_id = ' . $station_id . ' and station_profile.user_id = ' . $this->session->userdata('user_id');
$query = $this->db->query($sql);
@ -926,12 +926,12 @@ class Logbook_model extends CI_Model {
* Function returns all the station_id's with QRZ API Key's
*/
function get_station_id_with_qrz_api() {
$sql = 'select station_id from station_profile
$sql = 'select station_id, qrzapikey from station_profile
where coalesce(qrzapikey, "") <> ""';
$query = $this->db->query($sql);
$result = $query->row();
$result = $query->result();
if ($result) {
return $result;

查看文件

@ -269,7 +269,8 @@ class Stations extends CI_Model {
" where COL_QRZCOM_QSO_UPLOAD_STATUS = 'Y'
group by station_id
) as totc on station_profile.station_id = totc.station_id
where coalesce(station_profile.qrzapikey, '') <> ''";
where coalesce(station_profile.qrzapikey, '') <> ''
and station_profile.user_id = " . $this->session->userdata('user_id');
$query = $this->db->query($sql);
return $query;