Count via "distinct"
This commit is contained in:
parent
a32c10b354
commit
fdf47ef88f
1 changed files with 1 additions and 8 deletions
|
@ -212,14 +212,7 @@ function message_content(App $a)
|
||||||
|
|
||||||
$o .= $header;
|
$o .= $header;
|
||||||
|
|
||||||
$total = 0;
|
$total = DBA::count('mail', ['uid' => local_user()], ['distinct' => true, 'expression' => 'parent-uri']);
|
||||||
$r = DBA::fetchFirst("SELECT count(*) AS `total`, ANY_VALUE(`created`) AS `created` FROM `mail`
|
|
||||||
WHERE `mail`.`uid` = ? GROUP BY `parent-uri` ORDER BY `created` DESC",
|
|
||||||
local_user()
|
|
||||||
);
|
|
||||||
if (DBA::isResult($r)) {
|
|
||||||
$total = $r['total'];
|
|
||||||
}
|
|
||||||
|
|
||||||
$pager = new Pager(DI::l10n(), DI::args()->getQueryString());
|
$pager = new Pager(DI::l10n(), DI::args()->getQueryString());
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue