X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Freminder%2Fpromotion_ml.inc.php;h=a49e4e78fda9e3adcd0c37d91d124948057ba97d;hb=f336915bd25f046ed90b4d7e144384d7242adc97;hp=ffc33b2f38c632636ce3025de5582857ebdfe34b;hpb=1f64f1a78896aa527b081e5c7526963524f9bf8b;p=platal.git diff --git a/include/reminder/promotion_ml.inc.php b/include/reminder/promotion_ml.inc.php index ffc33b2..a49e4e7 100644 --- a/include/reminder/promotion_ml.inc.php +++ b/include/reminder/promotion_ml.inc.php @@ -26,14 +26,11 @@ class ReminderPromotionMl extends Reminder $user = S::user(); switch ($action) { case 'yes': - $res = XDB::query('SELECT id - FROM groups - WHERE diminutif = {?}', - $user->profile()->yearPromo()); - $asso_id = $res->fetchOneCell(); - XDB::execute('REPLACE INTO group_members (uid, asso_id) - VALUES ({?}, {?})', - $user->id(), $asso_id); + XDB::execute('INSERT IGNORE INTO group_members (uid, asso_id) + SELECT {?}, id + FROM groups + WHERE diminutif = {?}', + $user->id(), $user->profile()->yearPromo()); $mmlist = new MMList($user); $mmlist->subscribe('promo' . $user->profile()->yearPromo());