Merge pull request #2880 from AndreasK79/previous_qso_fix

Fixes query so that only qsos from your station_id is shown
这个提交包含在:
Andreas Kristiansen 2023-12-27 17:13:48 +01:00 提交者 GitHub
当前提交 0bcc82fcdd
找不到此签名对应的密钥
GPG 密钥 ID: 4AEE18F83AFDEB23

查看文件

@ -209,7 +209,7 @@ class Logbook extends CI_Controller {
if(!empty($logbooks_locations_array)) { if(!empty($logbooks_locations_array)) {
$extrawhere=''; $extrawhere='';
if (isset($user_default_confirmation) && strpos($user_default_confirmation, 'Q') !== false) { if (isset($user_default_confirmation) && strpos($user_default_confirmation, 'Q') !== false) {
$extrawhere="COL_QSL_RCVD='Y'"; $extrawhere="COL_QSL_RCVD='Y'";
} }
if (isset($user_default_confirmation) && strpos($user_default_confirmation, 'L') !== false) { if (isset($user_default_confirmation) && strpos($user_default_confirmation, 'L') !== false) {
if ($extrawhere!='') { if ($extrawhere!='') {
@ -336,10 +336,10 @@ class Logbook extends CI_Controller {
$return['workedBefore'] = true; $return['workedBefore'] = true;
} }
$extrawhere=''; $extrawhere='';
if (isset($user_default_confirmation) && strpos($user_default_confirmation, 'Q') !== false) { if (isset($user_default_confirmation) && strpos($user_default_confirmation, 'Q') !== false) {
$extrawhere="COL_QSL_RCVD='Y'"; $extrawhere="COL_QSL_RCVD='Y'";
} }
if (isset($user_default_confirmation) && strpos($user_default_confirmation, 'L') !== false) { if (isset($user_default_confirmation) && strpos($user_default_confirmation, 'L') !== false) {
if ($extrawhere!='') { if ($extrawhere!='') {
@ -427,7 +427,7 @@ class Logbook extends CI_Controller {
$extrawhere=''; $extrawhere='';
if (isset($user_default_confirmation) && strpos($user_default_confirmation, 'Q') !== false) { if (isset($user_default_confirmation) && strpos($user_default_confirmation, 'Q') !== false) {
$extrawhere="COL_QSL_RCVD='Y'"; $extrawhere="COL_QSL_RCVD='Y'";
} }
if (isset($user_default_confirmation) && strpos($user_default_confirmation, 'L') !== false) { if (isset($user_default_confirmation) && strpos($user_default_confirmation, 'L') !== false) {
if ($extrawhere!='') { if ($extrawhere!='') {
@ -528,7 +528,7 @@ class Logbook extends CI_Controller {
$extrawhere=''; $extrawhere='';
if (isset($user_default_confirmation) && strpos($user_default_confirmation, 'Q') !== false) { if (isset($user_default_confirmation) && strpos($user_default_confirmation, 'Q') !== false) {
$extrawhere="COL_QSL_RCVD='Y'"; $extrawhere="COL_QSL_RCVD='Y'";
} }
if (isset($user_default_confirmation) && strpos($user_default_confirmation, 'L') !== false) { if (isset($user_default_confirmation) && strpos($user_default_confirmation, 'L') !== false) {
if ($extrawhere!='') { if ($extrawhere!='') {
@ -683,7 +683,7 @@ class Logbook extends CI_Controller {
} }
echo "]"; echo "]";
// [MAP Custom] ADD Station // // [MAP Custom] ADD Station //
$this->load->model('Stations'); $this->load->model('Stations');
$station_json = $this->Stations->get_station_json_for_map(); $station_json = $this->Stations->get_station_json_for_map();
@ -737,12 +737,13 @@ class Logbook extends CI_Controller {
$this->db->join('station_profile', 'station_profile.station_id = '.$this->config->item('table_name').'.station_id'); $this->db->join('station_profile', 'station_profile.station_id = '.$this->config->item('table_name').'.station_id');
$this->db->where_in('station_profile.station_id', $logbooks_locations_array); $this->db->where_in('station_profile.station_id', $logbooks_locations_array);
$this->db->order_by(''.$this->config->item('table_name').'.COL_TIME_ON', "desc");
$this->db->group_start();
$this->db->where($this->config->item('table_name').'.COL_CALL', $id); $this->db->where($this->config->item('table_name').'.COL_CALL', $id);
$this->db->or_like($this->config->item('table_name').'.COL_CALL', '/'.$id,'before'); $this->db->or_like($this->config->item('table_name').'.COL_CALL', '/'.$id,'before');
$this->db->or_like($this->config->item('table_name').'.COL_CALL', $id.'/','after'); $this->db->or_like($this->config->item('table_name').'.COL_CALL', $id.'/','after');
$this->db->or_like($this->config->item('table_name').'.COL_CALL', '/'.$id.'/'); $this->db->or_like($this->config->item('table_name').'.COL_CALL', '/'.$id.'/');
$this->db->group_end();
$this->db->order_by($this->config->item('table_name').".COL_TIME_ON", "desc"); $this->db->order_by($this->config->item('table_name').".COL_TIME_ON", "desc");
$this->db->limit(5); $this->db->limit(5);