fix: [API] various fixes to the timestamp handling

pull/3725/head
iglocska 2018-09-11 23:20:00 +02:00
parent 60110a597c
commit 45c882b420
2 changed files with 8 additions and 3 deletions

View File

@ -3633,7 +3633,8 @@ class Attribute extends AppModel
'type' => array('function' => 'set_filter_simple_attribute'),
'tags' => array('function' => 'set_filter_tags'),
'uuid' => array('function' => 'set_filter_uuid'),
'deleted' => array('function' => 'set_filter_deleted')
'deleted' => array('function' => 'set_filter_deleted'),
'timestamp' => array('function' => 'set_filter_timestamp'),
),
'Event' => array(
'eventid' => array('function' => 'set_filter_eventid'),
@ -3643,7 +3644,6 @@ class Attribute extends AppModel
'from' => array('function' => 'set_filter_timestamp'),
'to' => array('function' => 'set_filter_timestamp'),
'last' => array('function' => 'set_filter_timestamp'),
'timestamp' => array('function' => 'set_filter_timestamp'),
'publish_timestamp' => array('function' => 'set_filter_timestamp'),
'org' => array('function' => 'set_filter_org'),
'uuid' => array('function' => 'set_filter_uuid'),

View File

@ -2106,9 +2106,14 @@ class Event extends AppModel
} elseif ($options['filter'] == 'to') {
$conditions['AND']['Event.date <='] = $params['to'];
} else {
if (empty($options['scope'])) {
$scope = 'Attribute';
} else {
$scope = $options['scope'];
}
$filters = array(
'timestamp' => array(
'Event.timestamp'
$scope . '.timestamp'
),
'publish_timestamp' => array(
'Event.publish_timestamp'