fix posts created at test (#7977)

This commit is contained in:
Chris
2017-12-14 05:37:51 -06:00
committed by GitHub
parent ddd99f7476
commit 4127474b47
2 changed files with 7 additions and 12 deletions

View File

@@ -1030,10 +1030,10 @@ func (s SqlPostStore) AnalyticsPostCount(teamId string, mustHaveFile bool, mustH
func (s SqlPostStore) GetPostsCreatedAt(channelId string, time int64) store.StoreChannel {
return store.Do(func(result *store.StoreResult) {
query := `SELECT * FROM Posts WHERE CreateAt = :CreateAt`
query := `SELECT * FROM Posts WHERE CreateAt = :CreateAt AND ChannelId = :ChannelId`
var posts []*model.Post
_, err := s.GetReplica().Select(&posts, query, map[string]interface{}{"CreateAt": time})
_, err := s.GetReplica().Select(&posts, query, map[string]interface{}{"CreateAt": time, "ChannelId": channelId})
if err != nil {
result.Err = model.NewAppError("SqlPostStore.GetPostsCreatedAt", "store.sql_post.get_posts_created_att.app_error", nil, "channelId="+channelId+err.Error(), http.StatusInternalServerError)