mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-13 12:25:56 +00:00
try to calculate counters conditionally based on feed ids
This commit is contained in:
@@ -640,4 +640,20 @@ class Article extends Handler_Protected {
|
||||
return [$article_image, $article_stream, $article_kind];
|
||||
}
|
||||
|
||||
static function _feeds_of(array $article_ids) {
|
||||
$id_qmarks = arr_qmarks($article_ids);
|
||||
|
||||
$sth = DB::pdo()->prepare("SELECT DISTINCT feed_id FROM ttrss_entries e, ttrss_user_entries ue
|
||||
WHERE ue.ref_id = e.id AND id IN ($id_qmarks)");
|
||||
|
||||
$sth->execute($article_ids);
|
||||
|
||||
$rv = [];
|
||||
|
||||
while ($row = $sth->fetch()) {
|
||||
array_push($rv, $row["feed_id"]);
|
||||
}
|
||||
|
||||
return $rv;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user