Commit cab7d129 authored by Nigel McNie's avatar Nigel McNie Committed by Nigel McNie
Browse files

More munging in the step 4 replier.

parent 326c9f05
...@@ -48,12 +48,19 @@ switch ($type) { ...@@ -48,12 +48,19 @@ switch ($type) {
$userdata = get_user_results($query, $limit, $offset); $userdata = get_user_results($query, $limit, $offset);
$groupdata = get_group_results($query, $limit, $offset); $groupdata = get_group_results($query, $limit, $offset);
$resultdata = array(); $resultdata = array();
$i = 0;
foreach ($userdata['data'] as $result) { foreach ($userdata['data'] as $result) {
$i++;
$resultdata[] = $result; $resultdata[] = $result;
} }
if ($groupdata['data']) {
foreach ($groupdata['data'] as $result) { foreach ($groupdata['data'] as $result) {
if ($i++ >= $limit) {
break;
}
$resultdata[] = $result; $resultdata[] = $result;
} }
}
$data = array( $data = array(
'count' => $userdata['count'] + $groupdata['count'], 'count' => $userdata['count'] + $groupdata['count'],
'limit' => $limit, 'limit' => $limit,
...@@ -88,12 +95,14 @@ function get_user_results($query, $limit, $offset) { ...@@ -88,12 +95,14 @@ function get_user_results($query, $limit, $offset) {
function get_group_results($query, $limit, $offset) { function get_group_results($query, $limit, $offset) {
$data = search_group($query, $limit, $offset); $data = search_group($query, $limit, $offset);
if ($data['data']) {
foreach ($data['data'] as &$result) { foreach ($data['data'] as &$result) {
unset($result->owner); unset($result->owner);
unset($result->description); unset($result->description);
unset($result->ctime); unset($result->ctime);
unset($result->mtime); unset($result->mtime);
} }
}
return $data; return $data;
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment