X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=bin%2Fcron%2Fregistrations.php;h=825ed62015fe8dec52b03087ff16b7751b15007c;hb=3424387cde6c635ff16c3b5459c4caa88bb76e2e;hp=91cb1ac99d89ab5039605cb2b9c9aada63fb4591;hpb=d82359a556779137f8a90d0312b3098a2db6f482;p=platal.git diff --git a/bin/cron/registrations.php b/bin/cron/registrations.php index 91cb1ac..825ed62 100755 --- a/bin/cron/registrations.php +++ b/bin/cron/registrations.php @@ -5,19 +5,20 @@ require 'connect.db.inc.php'; $message = ''; -$res = XDB::iterRow("SELECT a.registration_date, a.hruid, s.email - FROM accounts AS a - INNER JOIN account_profiles AS ap ON (ap.uid = a.uid AND FIND_IN_SET('owner', ap.perms)) - INNER JOIN profile_display AS pd ON (ap.pid = pd.pid) - LEFT JOIN email_source_account AS s ON (a.uid = s.uid) +$res = XDB::iterRow("SELECT DATE(a.registration_date), a.hruid, GROUP_CONCAT(DISTINCT r.redirect SEPARATOR ', ') + FROM accounts AS a + INNER JOIN account_profiles AS ap ON (ap.uid = a.uid AND FIND_IN_SET('owner', ap.perms)) + INNER JOIN profile_display AS pd ON (ap.pid = pd.pid) + LEFT JOIN email_source_account AS s ON (a.uid = s.uid) + LEFT JOIN email_redirect_account AS r ON (a.uid = r.uid) WHERE a.registration_date > {?} GROUP BY a.hruid ORDER BY pd.promo", date("Ymd000000", strtotime('last Monday'))); if ($count = $res->total()) { $message .= "$count INSCRIPTIONS CONFIRMÉES CETTE SEMAINE :\n"; - while (list($date, $hruid, $email) = $res->next()) { - $message .= "$date, $hruid, $email\n"; + while (list($date, $hruid, $email, $redirect) = $res->next()) { + $message .= "$date, $hruid, $email, $redirect\n"; } } @@ -51,5 +52,5 @@ $mailer->addTo($globals->register->notif); $mailer->setTxtBody($message); $mailer->send(); -// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: +// vim:set et sw=4 sts=4 sws=4 foldmethod=marker fenc=utf-8: ?>