X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModel%2FCircle.php;h=92e3ea656010a6fed2c439a1e87c1929a467864f;hb=999c56a2845ba94cc7c6950a2c951fedc8c966b6;hp=2b32103db99715a56e0f8d9dd36fca9e61cb6b45;hpb=aee420152fcbc1434e939f23c21d2b4a011c72f6;p=friendica.git diff --git a/src/Model/Circle.php b/src/Model/Circle.php index 2b32103db9..92e3ea6560 100644 --- a/src/Model/Circle.php +++ b/src/Model/Circle.php @@ -169,16 +169,17 @@ class Circle * * Count unread items of each circle of the local user * + * @param int $uid * @return array * 'id' => circle id * 'name' => circle name * 'count' => counted unseen circle items * @throws \Exception */ - public static function countUnseen() + public static function countUnseen(int $uid) { $stmt = DBA::p("SELECT `circle`.`id`, `circle`.`name`, - (SELECT COUNT(*) FROM `post-user-view` + (SELECT COUNT(*) FROM `post-user` WHERE `uid` = ? AND `unseen` AND `contact-id` IN @@ -188,8 +189,8 @@ class Circle ) AS `count` FROM `group` AS `circle` WHERE `circle`.`uid` = ?;", - DI::userSession()->getLocalUserId(), - DI::userSession()->getLocalUserId() + $uid, + $uid ); return DBA::toArray($stmt);