1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-06-09 07:58:56 +02:00

Merge pull request #3699 from nickvergessen/ticket/13823

[ticket/13823] Move the part of the query, so the update will get it …
This commit is contained in:
Joas Schilling 2015-06-10 22:26:16 +02:00
commit 2c65b9b133

View File

@ -506,9 +506,9 @@ class acp_prune
WHERE ug.group_id = ' . (int) $group_id . ' WHERE ug.group_id = ' . (int) $group_id . '
AND ug.user_id <> ' . ANONYMOUS . ' AND ug.user_id <> ' . ANONYMOUS . '
AND u.user_type <> ' . USER_FOUNDER . ' AND u.user_type <> ' . USER_FOUNDER . '
AND ug.user_pending = 0 ' . AND ug.user_pending = 0
(!empty($user_ids) ? ' AND ' . $db->sql_in_set('ug.user_id', $user_ids) : '') . ' AND u.user_id = ug.user_id
AND u.user_id = ug.user_id'; ' . (!empty($user_ids) ? ' AND ' . $db->sql_in_set('ug.user_id', $user_ids) : '');
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
// we're performing an intersection operation, so all the relevant users // we're performing an intersection operation, so all the relevant users
@ -532,10 +532,10 @@ class acp_prune
$sql = 'SELECT u.user_id, u.username, COUNT(p.post_id) AS queue_posts $sql = 'SELECT u.user_id, u.username, COUNT(p.post_id) AS queue_posts
FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . ' u FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . ' u
WHERE u.user_id <> ' . ANONYMOUS . ' WHERE u.user_id <> ' . ANONYMOUS . '
AND u.user_type <> ' . USER_FOUNDER . AND u.user_type <> ' . USER_FOUNDER . '
(!empty($user_ids) ? ' AND ' . $db->sql_in_set('p.poster_id', $user_ids) : '') . '
AND ' . $db->sql_in_set('p.post_visibility', array(ITEM_UNAPPROVED, ITEM_REAPPROVE)) . ' AND ' . $db->sql_in_set('p.post_visibility', array(ITEM_UNAPPROVED, ITEM_REAPPROVE)) . '
AND u.user_id = p.poster_id AND u.user_id = p.poster_id
' . (!empty($user_ids) ? ' AND ' . $db->sql_in_set('p.poster_id', $user_ids) : '') . '
GROUP BY p.poster_id GROUP BY p.poster_id
HAVING queue_posts ' . $key_match[$queue_select] . ' ' . $posts_on_queue; HAVING queue_posts ' . $key_match[$queue_select] . ' ' . $posts_on_queue;
$result = $db->sql_query($sql); $result = $db->sql_query($sql);