From 29fffed4b54a013a275fc0eedbd0b2a4ce0654e6 Mon Sep 17 00:00:00 2001 From: Dan Marsden Date: Wed, 28 Jun 2017 11:07:30 +1200 Subject: [PATCH] Use lasttaken instead of session end to obtain sessions to calculate --- locallib.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/locallib.php b/locallib.php index ab27a19..7f663bf 100644 --- a/locallib.php +++ b/locallib.php @@ -763,8 +763,7 @@ function attendance_get_users_to_notify($courseids = array(), $orderby = '', $si GROUP BY attendanceid, setnumber) stm ON (stm.setnumber = ats.statusset AND stm.attendanceid = ats.attendanceid) {$joingroup} - WHERE (ats.sessdate + ats.duration) >= {$sincetime} {$where} - AND ats.lasttaken != 0 + WHERE ats.lasttaken >= {$sincetime} {$where} GROUP BY uniqueid, a.id, a.name, a.course, c.fullname, atl.studentid, n.id, n.warningpercent, n.emailsubject, n.emailcontent, n.emailcontentformat, n.warnafter, n.emailuser, n.thirdpartyemails, ns.timesent, cm.id, c.id, {$unames2}