remove duplication from unconfirmed angeltypes hint

This commit is contained in:
Philip Häusler 2015-07-27 17:05:11 +02:00
parent 4f7f4a33f7
commit 386a3c3298
1 changed files with 4 additions and 2 deletions

View File

@ -19,13 +19,15 @@ function User_angeltypes($user) {
*/
function User_unconfirmed_AngelTypes($user) {
return sql_select("
SELECT `UnconfirmedMembers`.*, `AngelTypes`.`name` FROM `UserAngelTypes`
SELECT `UserAngelTypes`.*, `AngelTypes`.`name` FROM `UserAngelTypes`
JOIN `AngelTypes` ON `UserAngelTypes`.`angeltype_id`=`AngelTypes`.`id`
JOIN `UserAngelTypes` as `UnconfirmedMembers` ON `UserAngelTypes`.`angeltype_id`=`UnconfirmedMembers`.`angeltype_id`
WHERE `UserAngelTypes`.`user_id`='" . sql_escape($user['UID']) . "'
AND `UserAngelTypes`.`coordinator`=TRUE
AND `AngelTypes`.`restricted`=TRUE
AND `UnconfirmedMembers`.`confirm_user_id` IS NULL");
AND `UnconfirmedMembers`.`confirm_user_id` IS NULL
GROUP BY `UserAngelTypes`.`user_id`
ORDER BY `AngelTypes`.`name`");
}
/**