mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2026-11-30 12:14:36 -05:00
Merge pull request #5964 from AJ0070/web-review-followups
fix: montagereview StartDateTime swap and duplicate events from Filter::Events
This commit is contained in:
2 files changed
+5
-1
No files matched your search
@@ -895,7 +895,11 @@ class Filter extends ZM_Object {
|
||||
$query = dbQuery($sql);
|
||||
if (!$query) return $events;
|
||||
|
||||
// The tag joins give one row per tag, so an event with several tags comes back more than once
|
||||
$seen = array();
|
||||
while ($row = dbFetchNext($query)) {
|
||||
if (isset($seen[$row['Id']])) continue;
|
||||
$seen[$row['Id']] = true;
|
||||
$event = new Event($row);
|
||||
$event->remove_from_cache();
|
||||
if (!$this->test_post_sql_conditions($event)) {
|
||||
|
||||
@@ -293,7 +293,7 @@ if (isset($minTime) && isset($maxTime)) {
|
||||
$maxTime = $temp;
|
||||
$terms = $filter->terms();
|
||||
foreach ($terms as &$term) {
|
||||
if ($term['attr'] != 'DateTime') continue;
|
||||
if ($term['attr'] != 'DateTime' and $term['attr'] != 'StartDateTime') continue;
|
||||
if ($term['op'] == '>=' or $term['op'] == '>') $term['val'] = $minTime;
|
||||
else if ($term['op'] == '<=' or $term['op'] == '<') $term['val'] = $maxTime;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user