Code Duplication    Length = 4-4 lines in 2 locations

main/inc/lib/sessionmanager.lib.php 1 location

@@ 5987-5990 (lines=4) @@
5984
            'login_user_id = ? ' => $userId,
5985
        );
5986
5987
        if (!empty($from) && !empty($until)) {
5988
            $whereConditions["AND (login_date >= '?' "] = $from;
5989
            $whereConditions["AND logout_date <= DATE_ADD('?', INTERVAL 1 DAY)) "] = $until;
5990
        }
5991
5992
        $trackResult = Database::select(
5993
            'SEC_TO_TIME(SUM(UNIX_TIMESTAMP(logout_date) - UNIX_TIMESTAMP(login_date))) as total_time',

main/inc/lib/usermanager.lib.php 1 location

@@ 4915-4918 (lines=4) @@
4912
            'AND session_id = ? ' => $sessionId
4913
        );
4914
4915
        if (!empty($from) && !empty($until)) {
4916
            $whereConditions["AND (login_course_date >= '?' "] = $from;
4917
            $whereConditions["AND logout_course_date <= DATE_ADD('?', INTERVAL 1 DAY)) "] = $until;
4918
        }
4919
4920
        $trackResult = Database::select(
4921
            'SUM(UNIX_TIMESTAMP(logout_course_date) - UNIX_TIMESTAMP(login_course_date)) as total_time',