Fix getting next event due to case of asc
This commit is contained in:
parent
630d9011f3
commit
9e6db17e68
|
@ -438,7 +438,7 @@ function getNearEvents() {
|
|||
$result = dbQuery($sql);
|
||||
$prevEvent = dbFetchNext($result);
|
||||
|
||||
$sql = 'SELECT E.Id AS Id, E.StartTime AS StartTime FROM Events AS E INNER JOIN Monitors AS M ON E.MonitorId = M.Id WHERE '.$sortColumn .' '.($sortOrder=='asc'?'>=':'<=').' \''.$event[$_REQUEST['sort_field']]."'".$_REQUEST['filter']['sql'].$midSql.' AND E.Id>'.$event['Id'] . ' ORDER BY '.$sortColumn.' '.($sortOrder=='ASC'?'ASC':'DESC');
|
||||
$sql = 'SELECT E.Id AS Id, E.StartTime AS StartTime FROM Events AS E INNER JOIN Monitors AS M ON E.MonitorId = M.Id WHERE '.$sortColumn .' '.($sortOrder=='ASC'?'>=':'<=').' \''.$event[$_REQUEST['sort_field']]."'".$_REQUEST['filter']['sql'].$midSql.' AND E.Id>'.$event['Id'] . ' ORDER BY '.$sortColumn.' '.($sortOrder=='ASC'?'ASC':'DESC');
|
||||
if ( $sortColumn != 'E.Id' ) {
|
||||
# When sorting by starttime, if we have two events with the same starttime (diffreent monitors) then we should sort secondly by Id
|
||||
$sql .= ', E.Id ASC';
|
||||
|
|
Loading…
Reference in New Issue