mirror of
https://github.com/Piwigo/Piwigo.git
synced 2025-04-27 19:59:56 +03:00
Fix "total_count" type on some WS methods
This commit is contained in:
parent
8fc3c9cd0e
commit
3f07808d7f
3 changed files with 8 additions and 4 deletions
|
@ -137,6 +137,7 @@ SELECT SQL_CALC_FOUND_ROWS i.*
|
|||
}
|
||||
|
||||
list($total_images) = pwg_db_fetch_row(pwg_query('SELECT FOUND_ROWS()'));
|
||||
$total_images = (int)$total_images;
|
||||
|
||||
// let's take care of adding the related albums to each photo
|
||||
if (count($image_ids) > 0)
|
||||
|
|
|
@ -243,6 +243,7 @@ SELECT DISTINCT ';
|
|||
if (isset($params['display']['total_count'])) {
|
||||
$total_count_query_result = pwg_query('SELECT FOUND_ROWS();');
|
||||
list($total_count) = pwg_db_fetch_row($total_count_query_result);
|
||||
$total_count = (int)$total_count;
|
||||
}
|
||||
while ($row = pwg_db_fetch_assoc($result))
|
||||
{
|
||||
|
@ -351,12 +352,14 @@ SELECT DISTINCT ';
|
|||
array(
|
||||
'page' => $params['page'],
|
||||
'per_page' => $params['per_page'],
|
||||
'count' => count($users)
|
||||
'count' => count($users),
|
||||
'total_count' => $total_count,
|
||||
)
|
||||
),
|
||||
'users' => new PwgNamedArray(array_values($users), 'user')
|
||||
);
|
||||
}
|
||||
// deprecated: kept for retrocompatibility
|
||||
if (isset($params['display']['total_count'])) {
|
||||
$method_result['total_count'] = $total_count;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue