Get Rid of CI-Syntax and implement timerange for DCL

This commit is contained in:
int2001
2025-09-10 12:04:06 +00:00
parent a4671120a1
commit 2a1cd6da4e

View File

@@ -4811,13 +4811,17 @@ class Logbook_model extends CI_Model {
}
if ($darc_dok != '') {
$this->db->select('COL_PRIMARY_KEY, COL_DARC_DOK');
$this->db->where('COL_CALL', $call);
$this->db->like('COL_TIME_ON', $time_on, 'after');
$this->db->where('COL_BAND', $band);
$this->db->where('COL_MODE', $mode);
$this->db->where_in('station_id', $logbooks_locations_array);
$check = $this->db->get($this->config->item('table_name'));
$bindings=[];
$sql="select COL_PRIMARY_KEY, COL_DARC_DOK from ".$this->config->item('table_name')."
where col_call=? and col_band=? and col_mode=? and station_id in ?
AND COL_TIME_ON >= DATE_ADD(DATE_FORMAT(?, '%Y-%m-%d %H:%i' ), INTERVAL -15 MINUTE) AND COL_TIME_ON <= DATE_ADD(DATE_FORMAT(?, '%Y-%m-%d %H:%i' ), INTERVAL +15 MINUTE)";
$bindings[]=$call;
$bindings[]=$band;
$bindings[]=$mode;
$bindings[]=$logbooks_locations_array;
$bindings[]=$time_on;
$bindings[]=$time_on;
$check = $this->db->query($sql,$bindings);
if ($check->num_rows() != 1) {
if ($ignoreAmbiguous == '1') {
return array();