1
0
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:
Andrew Dolgov
2021-02-24 09:47:26 +03:00
parent a42e8aad97
commit d6203bf350
7 changed files with 168 additions and 60 deletions

View File

@@ -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;
}
}