WHERE (props='' OR props='{}' OR props='{"disable_group_highlight":true}') AND posts.id in (SELECT postid FROM (
SELECT count(*) AS cnt, postid, channels.id, posts.userid FROM reactions
JOIN posts ON (postid=posts.id) JOIN channels ON (posts.channelid=channels.id) left JOIN teams ON (teams.id=channels.teamid)
- WHERE posts.deleteat = '0' AND channels.type='O' AND channels.id NOT IN ('4rxjday69jbj8pe5pdcx4ezesr') AND channels.id IN ('9twh9scp47g57dgjat61skni5w','6ry6x1jg73nsfpggpcudiw65hh') AND posts.createat > extract(epoch FROM (NOW() - INTERVAL '1 day'))*1000
+ WHERE posts.deleteat = '0' AND channels.type='O' AND channels.id NOT IN ('4rxjday69jbj8pe5pdcx4ezesr') AND posts.createat > extract(epoch FROM (NOW() - INTERVAL '1 day'))*1000
GROUP BY postid, channels.id, posts.userid
) AS a WHERE cnt >10) RETURNING *
""")