Commit 55bf5bdc authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Use hardcoded dates in logged-in user query for stats page (bug #759414)



Change-Id: Ic3d1a7020c72eef31d30691175dc2597ebf920fd
Signed-off-by: default avatarRichard Mansfield <richard.mansfield@catalyst.net.nz>
parent cf4a91ad
......@@ -2515,11 +2515,11 @@ function cron_site_data_daily() {
// Logged-in users
$interval = is_postgres() ? "'1 day'" : '1 day';
$where = "lastaccess >= CURRENT_DATE AND lastaccess < CURRENT_DATE + INTERVAL $interval";
$where = "lastaccess >= DATE(?) AND lastaccess < DATE(?)+ INTERVAL $interval";
insert_record('site_data', (object) array(
'ctime' => $time,
'type' => 'loggedin-users-daily',
'value' => count_records_select('usr', $where),
'value' => count_records_select('usr', $where, array($time, $time)),
));
// Process log file containing view visits
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment