Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
bb1f3156
Commit
bb1f3156
authored
Jul 20, 2010
by
Francois Marier
Browse files
admin/group: fix sql query broken on MySQL
Signed-off-by:
Francois Marier
<
francois@catalyst.net.nz
>
parent
0f7bdb84
Changes
1
Show whitespace changes
Inline
Side-by-side
htdocs/admin/groups/groups.php
View file @
bb1f3156
...
...
@@ -63,10 +63,15 @@ function search_submit(Pieform $form, $values) {
$groups
=
search_group
(
$query
,
$limit
,
$offset
,
'all'
);
if
(
$ids
=
array_map
(
create_function
(
'$a'
,
'return intval($a->id);'
),
$groups
[
'data'
]))
{
$sumsql
=
"(m.role = 'admin')"
;
if
(
is_postgres
())
{
$sumsql
.
=
'::int'
;
}
// Member & admin counts
$ids
=
join
(
','
,
$ids
);
$counts
=
get_records_sql_assoc
(
"
SELECT m.group, COUNT(m.member) AS members, SUM(
(m.role = 'admin')::int
) AS admins
SELECT m.group, COUNT(m.member) AS members, SUM(
$sumsql
) AS admins
FROM
{
group_member
}
m
WHERE m.group IN (
$ids
)
GROUP BY m.group"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment