Merge pull request #2347 from phl0/fixEmptyFilter

Look also for QSOs where QSL column is NULL or empty
pull/2354/head
Andreas Kristiansen 2023-07-29 18:28:17 +02:00 zatwierdzone przez GitHub
commit 37281f8fe6
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 36 dodań i 6 usunięć

Wyświetl plik

@ -48,29 +48,59 @@ class Logbookadvanced_model extends CI_Model {
} }
} }
if ($searchCriteria['qslSent'] !== '') { if ($searchCriteria['qslSent'] !== '') {
$conditions[] = "COL_QSL_SENT = ?"; $condition = "COL_QSL_SENT = ?";
if ($searchCriteria['qslSent'] == 'N') {
$condition = '('.$condition;
$condition .= " OR COL_QSL_SENT IS NULL OR COL_QSL_SENT = '')";
}
$conditions[] = $condition;
$binding[] = $searchCriteria['qslSent']; $binding[] = $searchCriteria['qslSent'];
} }
if ($searchCriteria['qslReceived'] !== '') { if ($searchCriteria['qslReceived'] !== '') {
$conditions[] = "COL_QSL_RCVD = ?"; $condition = "COL_QSL_RCVD = ?";
if ($searchCriteria['qslReceived'] == 'N') {
$condition = '('.$condition;
$condition .= " OR COL_QSL_RCVD IS NULL OR COL_QSL_RCVD = '')";
}
$conditions[] = $condition;
$binding[] = $searchCriteria['qslReceived']; $binding[] = $searchCriteria['qslReceived'];
} }
if ($searchCriteria['lotwSent'] !== '') { if ($searchCriteria['lotwSent'] !== '') {
$conditions[] = "COL_LOTW_QSL_SENT = ?"; $condition = "COL_LOTW_QSL_SENT = ?";
if ($searchCriteria['lotwSent'] == 'N') {
$condition = '('.$condition;
$condition .= " OR COL_LOTW_QSL_SENT IS NULL OR COL_LOTW_QSL_SENT = '')";
}
$conditions[] = $condition;
$binding[] = $searchCriteria['lotwSent']; $binding[] = $searchCriteria['lotwSent'];
} }
if ($searchCriteria['lotwReceived'] !== '') { if ($searchCriteria['lotwReceived'] !== '') {
$conditions[] = "COL_LOTW_QSL_RCVD = ?"; $condition = "COL_LOTW_QSL_RCVD = ?";
if ($searchCriteria['lotwReceived'] == 'N') {
$condition = '('.$condition;
$condition .= " OR COL_LOTW_QSL_RCVD IS NULL OR COL_LOTW_QSL_RCVD = '')";
}
$conditions[] = $condition;
$binding[] = $searchCriteria['lotwReceived']; $binding[] = $searchCriteria['lotwReceived'];
} }
if ($searchCriteria['eqslSent'] !== '') { if ($searchCriteria['eqslSent'] !== '') {
$conditions[] = "COL_EQSL_QSL_SENT = ?"; $condition = "COL_EQSL_SENT = ?";
if ($searchCriteria['eqslSent'] == 'N') {
$condition = '('.$condition;
$condition .= " OR COL_EQSL_SENT IS NULL OR COL_EQSL_SENT = '')";
}
$conditions[] = $condition;
$binding[] = $searchCriteria['eqslSent']; $binding[] = $searchCriteria['eqslSent'];
} }
if ($searchCriteria['eqslReceived'] !== '') { if ($searchCriteria['eqslReceived'] !== '') {
$conditions[] = "COL_EQSL_QSL_RCVD = ?"; $condition = "COL_EQSL_RCVD = ?";
if ($searchCriteria['eqslReceived'] == 'N') {
$condition = '('.$condition;
$condition .= " OR COL_EQSL_RCVD IS NULL OR COL_EQSL_RCVD = '')";
}
$conditions[] = $condition;
$binding[] = $searchCriteria['eqslReceived']; $binding[] = $searchCriteria['eqslReceived'];
} }