diff options
author | Mario Vavti <mario@mariovavti.com> | 2018-02-09 14:06:59 +0100 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2018-02-09 14:06:59 +0100 |
commit | 5f229d81e9aaac0e0d82091d2d9089f5fb34bfe8 (patch) | |
tree | 35d6c83d72a2c6590d6a8c48b93532ca8fe001e5 /Zotlabs/Module/Channel.php | |
parent | cb70192f36816a0f642af7176932a431982fe376 (diff) | |
download | volse-hubzilla-5f229d81e9aaac0e0d82091d2d9089f5fb34bfe8.tar.gz volse-hubzilla-5f229d81e9aaac0e0d82091d2d9089f5fb34bfe8.tar.bz2 volse-hubzilla-5f229d81e9aaac0e0d82091d2d9089f5fb34bfe8.zip |
use distinct in channel item query and minor notification cache improvement
Diffstat (limited to 'Zotlabs/Module/Channel.php')
-rw-r--r-- | Zotlabs/Module/Channel.php | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Zotlabs/Module/Channel.php b/Zotlabs/Module/Channel.php index b7e18f954..dddca16b4 100644 --- a/Zotlabs/Module/Channel.php +++ b/Zotlabs/Module/Channel.php @@ -249,13 +249,13 @@ class Channel extends \Zotlabs\Web\Controller { } } else { - $r = q("SELECT id AS item_id FROM item + $r = q("SELECT DISTINCT item.parent AS item_id FROM item left join abook on item.author_xchan = abook.abook_xchan - WHERE uid = %d $item_normal - AND item_wall = 1 and item_thread_top = 1 - AND (abook_blocked = 0 or abook.abook_flags is null) + WHERE true and uid = %d $item_normal + AND (abook.abook_blocked = 0 or abook.abook_flags is null) + AND item.item_wall = 1 AND item.item_thread_top AND item.mid = item.parent_mid $sql_extra $sql_extra2 - ORDER BY created DESC, id $pager_sql ", + ORDER BY created DESC $pager_sql ", intval(\App::$profile['profile_uid']) ); } |