X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Freminder%2Fpromotion_ml.inc.php;h=1156e2a4ce4a62b23099d1b5126766cfecd3401c;hb=00ba8a742be0cfc70eef7c6aaaccebe7134ec087;hp=ffc33b2f38c632636ce3025de5582857ebdfe34b;hpb=abd508e0a9df441fa1dac740013c8e2ab09d54cc;p=platal.git diff --git a/include/reminder/promotion_ml.inc.php b/include/reminder/promotion_ml.inc.php index ffc33b2..1156e2a 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());