fix sql queries

This commit is contained in:
Isaac Connor 2017-01-02 11:05:08 -05:00
parent 9e435bc2c3
commit 40408bf6dd
1 changed files with 2 additions and 2 deletions

View File

@ -143,11 +143,11 @@ foreach( dbFetchAll( $monitorsSql ) as $row )
}
$rangeSql = "select min(E.StartTime) as MinTime, max(E.EndTime) as MaxTime from Events as E inner join Monitors as M on (E.MonitorId = M.Id) where not isnull(E.StartTime) and not isnull(E.EndTime)";
$eventsSql = "SELECT * FROM Events WHERE NOT isnull(StartTime)";
$eventsSql = "SELECT * FROM Events AS E WHERE NOT isnull(StartTime)";
if ( !empty($user['MonitorIds']) )
{
$monFilterSql = ' AND MonitorId IN ('.$user['MonitorIds'].')';
$monFilterSql = ' AND E.MonitorId IN ('.$user['MonitorIds'].')';
$rangeSql .= $monFilterSql;
$eventsSql .= $monFilterSql;