Reordered processing of incoming QSOs here. 1st check for dupes afterwards other logic
这个提交包含在:
父节点
bbdc9985ee
当前提交
d5dda2ef99
共有 1 个文件被更改,包括 536 次插入 和 535 次删除
|
|
@ -3152,6 +3152,72 @@ function lotw_last_qsl_date($user_id) {
|
||||||
$freqRX = NULL;
|
$freqRX = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Store Band
|
||||||
|
if(isset($record['band'])) {
|
||||||
|
$band = strtolower($record['band']);
|
||||||
|
} else {
|
||||||
|
if (isset($record['freq'])){
|
||||||
|
if($freq != "0") {
|
||||||
|
$band = $this->frequency->GetBand($freq);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(isset($record['band_rx'])) {
|
||||||
|
$band_rx = strtolower($record['band_rx']);
|
||||||
|
} else {
|
||||||
|
if (isset($record['freq_rx'])){
|
||||||
|
if($freq != "0") {
|
||||||
|
$band_rx = $this->frequency->GetBand($freqRX);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$band_rx = "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($record['mode'])) {
|
||||||
|
$input_mode = $record['mode'];
|
||||||
|
} else {
|
||||||
|
$input_mode = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
$mode = $this->get_main_mode_if_submode($input_mode);
|
||||||
|
if ($mode == null) {
|
||||||
|
$submode = null;
|
||||||
|
} else {
|
||||||
|
$submode = $input_mode;
|
||||||
|
$input_mode = $mode;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (empty($submode)) {
|
||||||
|
$input_submode = (!empty($record['submode'])) ? $record['submode'] : '';
|
||||||
|
} else {
|
||||||
|
$input_submode = $submode;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Check if QSO is already in the database
|
||||||
|
if ($skipDuplicate != NULL) {
|
||||||
|
$skip = false;
|
||||||
|
} else {
|
||||||
|
if (isset($record['call'])){
|
||||||
|
$this->db->where('COL_CALL', $record['call']);
|
||||||
|
}
|
||||||
|
$this->db->where("DATE_FORMAT(COL_TIME_ON, '%Y-%m-%d %H:%i') = DATE_FORMAT(\"".$time_on."\", '%Y-%m-%d %H:%i')");
|
||||||
|
$this->db->where('COL_BAND', $band);
|
||||||
|
$this->db->where('COL_MODE', $input_mode);
|
||||||
|
$this->db->where('station_id', $station_id);
|
||||||
|
$check = $this->db->get($this->config->item('table_name'));
|
||||||
|
|
||||||
|
// If dupe is not found, set variable to add QSO
|
||||||
|
if ($check->num_rows() <= 0) {
|
||||||
|
$skip = false;
|
||||||
|
} else {
|
||||||
|
$skip = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!($skip)) {
|
||||||
// DXCC id
|
// DXCC id
|
||||||
if (isset($record['call'])){
|
if (isset($record['call'])){
|
||||||
if ($dxccAdif != NULL) {
|
if ($dxccAdif != NULL) {
|
||||||
|
|
@ -3190,29 +3256,6 @@ function lotw_last_qsl_date($user_id) {
|
||||||
$rst_tx = "59";
|
$rst_tx = "59";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Store Band
|
|
||||||
if(isset($record['band'])) {
|
|
||||||
$band = strtolower($record['band']);
|
|
||||||
} else {
|
|
||||||
if (isset($record['freq'])){
|
|
||||||
if($freq != "0") {
|
|
||||||
$band = $this->frequency->GetBand($freq);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(isset($record['band_rx'])) {
|
|
||||||
$band_rx = strtolower($record['band_rx']);
|
|
||||||
} else {
|
|
||||||
if (isset($record['freq_rx'])){
|
|
||||||
if($freq != "0") {
|
|
||||||
$band_rx = $this->frequency->GetBand($freqRX);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$band_rx = "";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(isset($record['cqz'])) {
|
if(isset($record['cqz'])) {
|
||||||
$cq_zone = $record['cqz'];
|
$cq_zone = $record['cqz'];
|
||||||
} elseif(isset($dxcc[2])) {
|
} elseif(isset($dxcc[2])) {
|
||||||
|
|
@ -3410,52 +3453,12 @@ function lotw_last_qsl_date($user_id) {
|
||||||
$input_lotw_qslsdate = NULL;
|
$input_lotw_qslsdate = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($record['mode'])) {
|
|
||||||
$input_mode = $record['mode'];
|
|
||||||
} else {
|
|
||||||
$input_mode = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
$mode = $this->get_main_mode_if_submode($input_mode);
|
|
||||||
if ($mode == null) {
|
|
||||||
$submode = null;
|
|
||||||
} else {
|
|
||||||
$submode = $input_mode;
|
|
||||||
$input_mode = $mode;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (empty($submode)) {
|
|
||||||
$input_submode = (!empty($record['submode'])) ? $record['submode'] : '';
|
|
||||||
} else {
|
|
||||||
$input_submode = $submode;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get active station_id from station profile if one hasn't been provided
|
// Get active station_id from station profile if one hasn't been provided
|
||||||
if($station_id == "" || $station_id == "0") {
|
if($station_id == "" || $station_id == "0") {
|
||||||
$this->load->model('stations');
|
$this->load->model('stations');
|
||||||
$station_id = $this->stations->find_active();
|
$station_id = $this->stations->find_active();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if QSO is already in the database
|
|
||||||
if ($skipDuplicate != NULL) {
|
|
||||||
$skip = false;
|
|
||||||
} else {
|
|
||||||
if (isset($record['call'])){
|
|
||||||
$this->db->where('COL_CALL', $record['call']);
|
|
||||||
}
|
|
||||||
$this->db->where("DATE_FORMAT(COL_TIME_ON, '%Y-%m-%d %H:%i') = DATE_FORMAT(\"".$time_on."\", '%Y-%m-%d %H:%i')");
|
|
||||||
$this->db->where('COL_BAND', $band);
|
|
||||||
$this->db->where('COL_MODE', $input_mode);
|
|
||||||
$this->db->where('station_id', $station_id);
|
|
||||||
$check = $this->db->get($this->config->item('table_name'));
|
|
||||||
|
|
||||||
// If dupe is not found, set variable to add QSO
|
|
||||||
if ($check->num_rows() <= 0) {
|
|
||||||
$skip = false;
|
|
||||||
} else {
|
|
||||||
$skip = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($operatorName != false) {
|
if ($operatorName != false) {
|
||||||
$operatorName = $this->session->userdata('user_callsign');
|
$operatorName = $this->session->userdata('user_callsign');
|
||||||
|
|
@ -3480,8 +3483,6 @@ function lotw_last_qsl_date($user_id) {
|
||||||
$input_qrzcom_qso_upload_status = (!empty($record['qrzcom_qso_upload_status'])) ? $record['qrzcom_qso_upload_status'] : '';
|
$input_qrzcom_qso_upload_status = (!empty($record['qrzcom_qso_upload_status'])) ? $record['qrzcom_qso_upload_status'] : '';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$skip)
|
|
||||||
{
|
|
||||||
// Create array with QSO Data use ?:
|
// Create array with QSO Data use ?:
|
||||||
$data = array(
|
$data = array(
|
||||||
'COL_A_INDEX' => $input_a_index,
|
'COL_A_INDEX' => $input_a_index,
|
||||||
|
|
|
||||||
正在加载…
在新工单中引用