diff options
author | Andrew Dolgov <[email protected]> | 2021-02-24 09:47:26 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2021-02-24 09:47:26 +0300 |
commit | d6203bf3508ba77e3943ddc412eb562edb327f22 (patch) | |
tree | eb0e56ff62add4705c200903d559fa7d3f412acb /classes/article.php | |
parent | a42e8aad97b66fd4964263e37a1b40164e495b4c (diff) |
try to calculate counters conditionally based on feed ids
Diffstat (limited to 'classes/article.php')
-rwxr-xr-x | classes/article.php | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/classes/article.php b/classes/article.php index a2a38118b..4bf563c4b 100755 --- a/classes/article.php +++ b/classes/article.php @@ -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; + } } |