Code Duplication    Length = 4-4 lines in 2 locations

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

@@ 5292-5295 (lines=4) @@
5289
            'AND session_id = ? ' => $sessionId
5290
        );
5291
5292
        if (!empty($from) && !empty($until)) {
5293
            $whereConditions["AND (login_course_date >= '?' "] = $from;
5294
            $whereConditions["AND logout_course_date <= DATE_ADD('?', INTERVAL 1 DAY)) "] = $until;
5295
        }
5296
5297
        $trackResult = Database::select(
5298
            'SUM(UNIX_TIMESTAMP(logout_course_date) - UNIX_TIMESTAMP(login_course_date)) as total_time',

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

@@ 6271-6274 (lines=4) @@
6268
            'login_user_id = ? ' => $userId,
6269
        );
6270
6271
        if (!empty($from) && !empty($until)) {
6272
            $whereConditions["AND (login_date >= '?' "] = $from;
6273
            $whereConditions["AND logout_date <= DATE_ADD('?', INTERVAL 1 DAY)) "] = $until;
6274
        }
6275
6276
        $trackResult = Database::select(
6277
            'SEC_TO_TIME(SUM(UNIX_TIMESTAMP(logout_date) - UNIX_TIMESTAMP(login_date))) as total_time',