Improve DXCC ID assignment logic in Logbook_model
Refines how DXCC ID is set based on country and input values, ensuring correct assignment when country is provided and dxcc_id is zero. This helps prevent incorrect DXCC ID values during logbook entry creation.
这个提交包含在:
父节点
1ebb3a9942
当前提交
adf658903b
共有 1 个文件被更改,包括 10 次插入 和 1 次删除
|
|
@ -99,10 +99,13 @@ class Logbook_model extends CI_Model
|
|||
if ($this->input->post('country') == "") {
|
||||
$dxcc = $this->check_dxcc_table(strtoupper(trim($callsign)), $datetime);
|
||||
$country = ucwords(strtolower($dxcc[1]), "- (/");
|
||||
$dxcc_id = $dxcc[0];
|
||||
} else {
|
||||
$country = $this->input->post('country');
|
||||
}
|
||||
|
||||
|
||||
|
||||
if ($this->input->post('cqz') == "") {
|
||||
$dxcc = $this->check_dxcc_table(strtoupper(trim($callsign)), $datetime);
|
||||
if (empty($dxcc[2])) {
|
||||
|
|
@ -123,7 +126,13 @@ class Logbook_model extends CI_Model
|
|||
$dxcc_id = $dxcc[0];
|
||||
}
|
||||
} else {
|
||||
$dxcc_id = $this->input->post('dxcc_id');
|
||||
// if $country isn't empty
|
||||
if (!empty($country) && $this->input->post('dxcc_id') == "0") {
|
||||
$dxcc_id = $dxcc_id;
|
||||
} else {
|
||||
$dxcc_id = $this->input->post('dxcc_id');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if ($this->input->post('continent') == "") {
|
||||
|
|
|
|||
正在加载…
在新工单中引用