summaryrefslogtreecommitdiffstats
path: root/store/sql_post_store.go
diff options
context:
space:
mode:
Diffstat (limited to 'store/sql_post_store.go')
-rw-r--r--store/sql_post_store.go11
1 files changed, 7 insertions, 4 deletions
diff --git a/store/sql_post_store.go b/store/sql_post_store.go
index e7c3a59a0..cd668b13c 100644
--- a/store/sql_post_store.go
+++ b/store/sql_post_store.go
@@ -286,7 +286,7 @@ func (s SqlPostStore) GetPostsSince(channelId string, time int64) StoreChannel {
WHERE
(UpdateAt > :Time
AND ChannelId = :ChannelId)
- LIMIT 100)
+ LIMIT 1000)
UNION
(SELECT
*
@@ -302,7 +302,7 @@ func (s SqlPostStore) GetPostsSince(channelId string, time int64) StoreChannel {
WHERE
UpdateAt > :Time
AND ChannelId = :ChannelId
- LIMIT 100) temp_tab))
+ LIMIT 1000) temp_tab))
ORDER BY CreateAt DESC`,
map[string]interface{}{"ChannelId": channelId, "Time": time})
@@ -314,7 +314,9 @@ func (s SqlPostStore) GetPostsSince(channelId string, time int64) StoreChannel {
for _, p := range posts {
list.AddPost(p)
- list.AddOrder(p.Id)
+ if p.UpdateAt > time {
+ list.AddOrder(p.Id)
+ }
}
result.Data = list
@@ -372,7 +374,8 @@ func (s SqlPostStore) getParentsPosts(channelId string, offset int, limit int) S
ChannelId = :ChannelId1
AND DeleteAt = 0
ORDER BY CreateAt DESC
- LIMIT :Limit OFFSET :Offset) q3) q1 ON q1.RootId = q2.RootId
+ LIMIT :Limit OFFSET :Offset) q3
+ WHERE q3.RootId != '') q1 ON q1.RootId = q2.Id
WHERE
ChannelId = :ChannelId2
AND DeleteAt = 0