Merge pull request #1478 from phl0/killDOKRegex

Replace REGEXP_LIKE in DOK stats
pull/1486/head
Peter Goodhall 2022-05-16 14:36:18 +01:00 zatwierdzone przez GitHub
commit 6fe44f3b57
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -16,9 +16,9 @@ class DOK extends CI_Model {
$location_list = "'".implode("','",$logbooks_locations_array)."'";
$sql = "select upper(COL_DARC_DOK) as COL_DARC_DOK, COL_MODE, lcase(COL_BAND) as COL_BAND, count(COL_DARC_DOK) as cnt from ".$this->config->item('table_name')." WHERE station_id in (" . $location_list . ") AND COL_DARC_DOK IS NOT NULL AND COL_DARC_DOK != '' AND COL_DXCC = 230";
if ($postdata['doks'] == 'dok') {
$sql .= " AND REGEXP_LIKE (COL_DARC_DOK, '^[A-Z][0-9]{2}$')";
$sql .= " AND COL_DARC_DOK REGEXP '^[A-Z][0-9]{2}$'";
} else if ($postdata['doks'] == 'sdok') {
$sql .= " AND NOT REGEXP_LIKE (COL_DARC_DOK, '^[A-Z][0-9]{2}$')";
$sql .= " AND COL_DARC_DOK NOT REGEXP '^[A-Z][0-9]{2}$'";
}
$sql .= " group by COL_DARC_DOK, COL_MODE, COL_BAND";
$sql .= " order by COL_DARC_DOK asc";