mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-01-29 00:53:34 +00:00
Tighten query for events within a time period.
This commit is contained in:
parent
fdb366161c
commit
63b28cbdbc
@ -122,10 +122,10 @@ function SqlFilterFragment( $filter, $components, $property = null, $parameter =
|
||||
if ( isset($start) && isset($finish) ) {
|
||||
$sql .= sprintf( "AND ( (%s >= %s::timestamp with time zone AND %s <= %s::timestamp with time zone) ",
|
||||
$start_column, qpg($start), $finish_column, qpg($finish));
|
||||
$sql .= sprintf( "OR (calculate_later_timestamp(%s::timestamp with time zone,%s,rrule) >= %s::timestamp with time zone ", qpg($start), $start_column, qpg($start) );
|
||||
$sql .= sprintf( "AND calculate_later_timestamp(%s::timestamp with time zone,%s,rrule) >= %s::timestamp with time zone ", qpg($finish), $finish_column, qpg($finish) );
|
||||
$sql .= sprintf( "AND calculate_later_timestamp(%s::timestamp with time zone,%s,rrule) <= ", qpg($start), $start_column );
|
||||
$sql .= sprintf( " calculate_later_timestamp(%s::timestamp with time zone,%s,rrule) ) ", qpg($finish), $finish_column );
|
||||
$sql .= sprintf( "OR (calculate_later_timestamp(%s::timestamp with time zone,%s,rrule) >= %s::timestamp with time zone ", qpg($start), $finish_column, qpg($start) );
|
||||
$sql .= sprintf( "AND calculate_later_timestamp(%s::timestamp with time zone,%s,rrule) <= %s::timestamp with time zone ", qpg($start), $start_column, qpg($finish) );
|
||||
$sql .= sprintf( "AND calculate_later_timestamp(%s::timestamp with time zone,%s,rrule) <= ", qpg($start), $finish_column );
|
||||
$sql .= sprintf( " calculate_later_timestamp(%s::timestamp with time zone,%s,rrule) ) ", qpg($start), $start_column );
|
||||
$sql .= sprintf( "OR event_has_exceptions(caldav_data.caldav_data) ) " );
|
||||
}
|
||||
else if ( isset($start) ) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user