From 48a0cc4afebba86aa62932e9bc8ac299cc2c6eba Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rapha=C3=ABl=20Barrois?= Date: Sat, 1 Oct 2011 14:15:32 +0200 Subject: [PATCH] Add account consultation statistics to weekly crons. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Raphaël Barrois --- bin/cron/checkdb.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/bin/cron/checkdb.php b/bin/cron/checkdb.php index fee4057..b7cdcb3 100755 --- a/bin/cron/checkdb.php +++ b/bin/cron/checkdb.php @@ -217,6 +217,20 @@ check("SELECT evd.name WHERE evd2.id != evd2.aliasing", "Domaines aliasés de niveau 2 ou plus qui ne sont pas vu par postfix."); +// Account viewing statistics +info("SELECT nb_profiles, hruid + FROM ( + SELECT a.hruid AS hruid, COUNT(DISTINCT le.data) AS nb_profiles + FROM log_events AS le + LEFT JOIN log_sessions AS ls ON (ls.id = le.session) + LEFT JOIN accounts AS a ON (a.uid = ls.uid) + WHERE le.action = 30 AND ls.start >= DATE_SUB(CURRENT_DATE, INTERVAL 7 DAY) + GROUP BY a.hruid + ) AS profile_views + WHERE nb_profiles >= 100 + ORDER BY nb_profiles DESC", + "Camarades ayant consulté plus de 100 fiches au cours des 7 derniers jours."); + // Counts empty profile fields that should never be empty. infoCountEmpty('profile_addresses', 'type'); infoCountEmpty('profile_phones', 'link_type'); -- 2.1.4