summaryrefslogtreecommitdiff
path: root/includes/model
diff options
context:
space:
mode:
authorPhilip Häusler <msquare@notrademark.de>2015-07-27 17:20:05 +0200
committerPhilip Häusler <msquare@notrademark.de>2015-07-27 17:20:05 +0200
commit1a0ccddbe9c2e04bdad10e08513ed0d709aa7bb6 (patch)
tree80fd397eec3a439fc343682be49346f051020a48 /includes/model
parent6376b90e9f7527f85542b4835fc56c4c9afb5604 (diff)
show number of user angel types to confirm in hint
Diffstat (limited to 'includes/model')
-rw-r--r--includes/model/UserAngelTypes_model.php14
1 files changed, 9 insertions, 5 deletions
diff --git a/includes/model/UserAngelTypes_model.php b/includes/model/UserAngelTypes_model.php
index fccabd96..b2ebd9fe 100644
--- a/includes/model/UserAngelTypes_model.php
+++ b/includes/model/UserAngelTypes_model.php
@@ -19,14 +19,18 @@ function User_angeltypes($user) {
*/
function User_unconfirmed_AngelTypes($user) {
return sql_select("
- SELECT `UserAngelTypes`.*, `AngelTypes`.`name` FROM `UserAngelTypes`
+ SELECT
+ `UserAngelTypes`.*,
+ `AngelTypes`.`name`,
+ count(`UnconfirmedMembers`.`user_id`) as `count`
+ 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
- GROUP BY `UserAngelTypes`.`user_id`
+ AND `UserAngelTypes`.`coordinator`=TRUE
+ AND `AngelTypes`.`restricted`=TRUE
+ AND `UnconfirmedMembers`.`confirm_user_id` IS NULL
+ GROUP BY `UserAngelTypes`.`angeltype_id`
ORDER BY `AngelTypes`.`name`");
}