[QRZ Logbook] Had to revert a few changes. Can't check user_id everywhere, since that will break cron

这个提交包含在:
Andreas 2021-11-25 20:43:31 +01:00
父节点 197eceeb79
当前提交 4ac4f612cb
共有 2 个文件被更改,包括 6 次插入12 次删除

查看文件

@ -24,10 +24,9 @@ class Qrz extends CI_Controller {
$station_ids = $this->logbook_model->get_station_id_with_qrz_api(); $station_ids = $this->logbook_model->get_station_id_with_qrz_api();
if ($station_ids) { if ($station_ids) {
foreach ($station_ids as $station_id) { foreach ($station_ids as $station) {
$result = $this->logbook_model->exists_qrz_api_key($station_id); $qrz_api_key = $station->qrzapikey;
$qrz_api_key = $result->qrzapikey; if($this->mass_upload_qsos($station->station_id, $qrz_api_key)) {
if($this->mass_upload_qsos($station_id, $qrz_api_key)) {
echo "QSOs have been uploaded to QRZ.com."; echo "QSOs have been uploaded to QRZ.com.";
log_message('info', 'QSOs have been uploaded to QRZ.com.'); log_message('info', 'QSOs have been uploaded to QRZ.com.');
} else{ } else{

查看文件

@ -444,10 +444,6 @@ class Logbook_model extends CI_Model {
* $primarykey is the unique id for that QSO in the logbook * $primarykey is the unique id for that QSO in the logbook
*/ */
function mark_qrz_qsos_sent($primarykey) { function mark_qrz_qsos_sent($primarykey) {
if (!$this->check_qso_is_accessible($primarykey)) {
return;
}
$data = array( $data = array(
'COL_QRZCOM_QSO_UPLOAD_DATE' => date("Y-m-d H:i:s", strtotime("now")), 'COL_QRZCOM_QSO_UPLOAD_DATE' => date("Y-m-d H:i:s", strtotime("now")),
'COL_QRZCOM_QSO_UPLOAD_STATUS' => 'Y', 'COL_QRZCOM_QSO_UPLOAD_STATUS' => 'Y',
@ -917,8 +913,7 @@ class Logbook_model extends CI_Model {
' and (COL_QRZCOM_QSO_UPLOAD_STATUS is NULL ' and (COL_QRZCOM_QSO_UPLOAD_STATUS is NULL
or COL_QRZCOM_QSO_UPLOAD_STATUS = "" or COL_QRZCOM_QSO_UPLOAD_STATUS = ""
or COL_QRZCOM_QSO_UPLOAD_STATUS = "M" or COL_QRZCOM_QSO_UPLOAD_STATUS = "M"
or COL_QRZCOM_QSO_UPLOAD_STATUS = "N") or COL_QRZCOM_QSO_UPLOAD_STATUS = "N")';
and station_profile.user_id = ' . $this->session->userdata('user_id');
$query = $this->db->query($sql); $query = $this->db->query($sql);
return $query; return $query;
@ -928,12 +923,12 @@ class Logbook_model extends CI_Model {
* Function returns all the station_id's with QRZ API Key's * Function returns all the station_id's with QRZ API Key's
*/ */
function get_station_id_with_qrz_api() { 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, "") <> ""'; where coalesce(qrzapikey, "") <> ""';
$query = $this->db->query($sql); $query = $this->db->query($sql);
$result = $query->row(); $result = $query->result();
if ($result) { if ($result) {
return $result; return $result;