Join Monitors as M as well in total and totalNotFiltered queries
This commit is contained in:
parent
96a9a73320
commit
0f74e24bfc
|
@ -223,9 +223,9 @@ function queryRequest($filter, $search, $advsearch, $sort, $offset, $order, $lim
|
|||
$data['rows'] = $rows;
|
||||
|
||||
# totalNotFiltered must equal total, except when either search bar has been used
|
||||
$data['totalNotFiltered'] = dbFetchOne('SELECT count(*) AS Total FROM ' .$table. ' AS E'. ($filter->sql() ? ' WHERE '.$filter->sql():''), 'Total');
|
||||
$data['totalNotFiltered'] = dbFetchOne('SELECT count(*) AS Total FROM Events AS E INNER JOIN Monitors AS M ON E.MonitorId = M.Id'. ($filter->sql() ? ' WHERE '.$filter->sql():''), 'Total');
|
||||
if ( $search != '' || count($advsearch) ) {
|
||||
$data['total'] = dbFetchOne('SELECT count(*) AS Total FROM ' .$table. ' AS E'.$where , 'Total', $wherevalues);
|
||||
$data['total'] = dbFetchOne('SELECT count(*) AS Total FROM Events AS E INNER JOIN Monitors AS M ON E.MonitorId = M.Id'.$where , 'Total', $wherevalues);
|
||||
} else {
|
||||
$data['total'] = $data['totalNotFiltered'];
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue