Code Duplication    Length = 4-4 lines in 2 locations

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

@@ 5321-5324 (lines=4) @@
5318
            'AND session_id = ? ' => $sessionId
5319
        );
5320
5321
        if (!empty($from) && !empty($until)) {
5322
            $whereConditions["AND (login_course_date >= '?' "] = $from;
5323
            $whereConditions["AND logout_course_date <= DATE_ADD('?', INTERVAL 1 DAY)) "] = $until;
5324
        }
5325
5326
        $trackResult = Database::select(
5327
            'SUM(UNIX_TIMESTAMP(logout_course_date) - UNIX_TIMESTAMP(login_course_date)) as total_time',

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

@@ 6325-6328 (lines=4) @@
6322
            'login_user_id = ? ' => $userId,
6323
        );
6324
6325
        if (!empty($from) && !empty($until)) {
6326
            $whereConditions["AND (login_date >= '?' "] = $from;
6327
            $whereConditions["AND logout_date <= DATE_ADD('?', INTERVAL 1 DAY)) "] = $until;
6328
        }
6329
6330
        $trackResult = Database::select(
6331
            'SEC_TO_TIME(SUM(UNIX_TIMESTAMP(logout_date) - UNIX_TIMESTAMP(login_date))) as total_time',