summaryrefslogtreecommitdiff
path: root/classes/ccache.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2017-12-01 19:42:02 +0300
committerAndrew Dolgov <[email protected]>2017-12-01 19:42:02 +0300
commitcc9450c309dbeedadaf23a8140520ab3726e3206 (patch)
tree0eab31a0472673505f42a6ccca8d78a0bb24f543 /classes/ccache.php
parent1271407eea5e4d98968b701025630c03d66ce5d1 (diff)
ccache, misc: fixes
feeds: start PDO transition
Diffstat (limited to 'classes/ccache.php')
-rw-r--r--classes/ccache.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/classes/ccache.php b/classes/ccache.php
index 0562c888c..9a6f14f3d 100644
--- a/classes/ccache.php
+++ b/classes/ccache.php
@@ -118,7 +118,8 @@ class CCache {
if (!$pcat_fast) {
$sth = $pdo->prepare("SELECT id FROM ttrss_feeds
- WHERE owner_uid = :uid AND cat_id = :cat OR (:cat = 0 AND cat_id IS NULL)");
+ WHERE owner_uid = :uid AND
+ (cat_id = :cat OR (:cat = 0 AND cat_id IS NULL))");
$sth->execute([":uid" => $owner_uid, ":cat" => $feed_id]);
while ($line = $sth->fetch()) {
@@ -129,7 +130,7 @@ class CCache {
$sth = $pdo->prepare("SELECT SUM(value) AS sv
FROM ttrss_counters_cache, ttrss_feeds
WHERE id = feed_id AND
- cat_id = :cat OR (:cat IS NULL AND cat_id IS NULL) AND
+ (cat_id = :cat OR (:cat = 0 AND cat_id IS NULL)) AND
ttrss_counters_cache.owner_uid = :uid AND
ttrss_feeds.owner_uid = :uid");
$sth->execute([":uid" => $owner_uid, ":cat" => $feed_id]);