From ee9fbda098b3c608176ced4425765e3029ca8f93 Mon Sep 17 00:00:00 2001 From: msquare Date: Fri, 29 Dec 2017 18:57:11 +0100 Subject: add work date to work log --- includes/pages/admin_active.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'includes/pages/admin_active.php') diff --git a/includes/pages/admin_active.php b/includes/pages/admin_active.php index 18553159..f3a28061 100644 --- a/includes/pages/admin_active.php +++ b/includes/pages/admin_active.php @@ -59,7 +59,8 @@ function admin_active() `User`.*, COUNT(`ShiftEntry`.`id`) AS `shift_count`, (%s + ( - SELECT SUM(`work_hours`) * 3600 FROM `UserWorkLog` WHERE `user_id`=`User`.`UID` + SELECT COALESCE(SUM(`work_hours`) * 3600, 0) FROM `UserWorkLog` WHERE `user_id`=`User`.`UID` + AND `work_timestamp` < %s )) AS `shift_length` FROM `User` LEFT JOIN `ShiftEntry` ON `User`.`UID` = `ShiftEntry`.`UID` @@ -71,6 +72,7 @@ function admin_active() %s ', $shift_sum_formula, + time(), $limit )); $user_nicks = []; @@ -143,7 +145,8 @@ function admin_active() `User`.*, COUNT(`ShiftEntry`.`id`) AS `shift_count`, (%s + ( - SELECT SUM(`work_hours`) * 3600 FROM `UserWorkLog` WHERE `user_id`=`User`.`UID` + SELECT COALESCE(SUM(`work_hours`) * 3600, 0) FROM `UserWorkLog` WHERE `user_id`=`User`.`UID` + AND `work_timestamp` < %s )) AS `shift_length` FROM `User` LEFT JOIN `ShiftEntry` ON `User`.`UID` = `ShiftEntry`.`UID` LEFT JOIN `Shifts` ON `ShiftEntry`.`SID` = `Shifts`.`SID` ' @@ -154,6 +157,7 @@ function admin_active() %s ', $shift_sum_formula, + time(), $limit )); $matched_users = []; -- cgit v1.2.3-54-g00ecf