From: Raphaël Barrois Date: Sat, 1 Oct 2011 12:15:32 +0000 (+0200) Subject: Add account consultation statistics to weekly crons. X-Git-Tag: xorg/1.1.4~113 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=48a0cc4afebba86aa62932e9bc8ac299cc2c6eba;p=platal.git Add account consultation statistics to weekly crons. Signed-off-by: Raphaël Barrois --- 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');