use primary key for QSO instead searching for it again

This commit is contained in:
HB9HIL
2024-06-15 00:09:11 +02:00
parent 9299804ffe
commit 0235816412
2 changed files with 4 additions and 7 deletions

View File

@@ -410,8 +410,8 @@ class Qrz extends CI_Controller {
$status = $this->logbook_model->import_check($time_on, $record['call'], $record['band'], $record['mode'], $record['station_callsign']);
if($status[0] == "Found") {
$qrz_status = $this->logbook_model->qrz_update($time_on, $record['call'], $record['band'], $qsl_date, $record['qsl_rcvd'],$record['station_callsign']);
$qrz_status = $this->logbook_model->qrz_update($status[1], $qsl_date, $record['qsl_rcvd']);
// log_message('error', $record['call'].": ".$qrz_status);
$table .= "<tr>";
$table .= "<td>".$record['station_callsign']."</td>";
$table .= "<td>".$time_on."</td>";

View File

@@ -3251,17 +3251,14 @@ function check_if_callsign_worked_in_logbook($callsign, $StationLocationsArray =
}
}
function qrz_update($datetime, $callsign, $band, $qsl_date, $qsl_status, $station_callsign) {
function qrz_update($primarykey, $qsl_date, $qsl_status) {
$data = array(
'COL_QRZCOM_QSO_DOWNLOAD_DATE' => $qsl_date,
'COL_QRZCOM_QSO_DOWNLOAD_STATUS' => $qsl_status,
);
$this->db->where('date_format(COL_TIME_ON, \'%Y-%m-%d %H:%i\') = "'.$datetime.'"');
$this->db->where('COL_CALL', $callsign);
$this->db->where('COL_BAND', $band);
$this->db->where('COL_STATION_CALLSIGN', $station_callsign);
$this->db->where('COL_PRIMARY_KEY', $primarykey);
if ($this->db->update($this->config->item('table_name'), $data)) {
unset($data);