作者 yangfu

Merge branch 'dev' into test

@@ -214,7 +214,7 @@ func (repository *ArticleRepository) FindAuthorsLatestFirstArticle(ctx context.C @@ -214,7 +214,7 @@ func (repository *ArticleRepository) FindAuthorsLatestFirstArticle(ctx context.C
214 tx = tx.Model(&ms).Select("max(id) id", "max(author_id) author_id", "max(created_at) created_at"). 214 tx = tx.Model(&ms).Select("max(id) id", "max(author_id) author_id", "max(created_at) created_at").
215 Where("company_id=?", companyId). 215 Where("company_id=?", companyId).
216 Where("author_id in (?)", authors). 216 Where("author_id in (?)", authors).
217 - Where("target_user=0 or who_read @>'[?]'", whoRead). 217 + Where("target_user=0 or who_read @>? ", fmt.Sprintf("[%d]", whoRead)).
218 Where("show = 1"). 218 Where("show = 1").
219 Group("author_id"). 219 Group("author_id").
220 Order("id desc") 220 Order("id desc")
@@ -254,7 +254,7 @@ func (repository *ArticleRepository) FindAuthorsLatestFirstUnreadArticle(ctx con @@ -254,7 +254,7 @@ func (repository *ArticleRepository) FindAuthorsLatestFirstUnreadArticle(ctx con
254 tx = tx.Model(&ms).Select("max(id) id", "max(author_id) author_id", "max(created_at) created_at"). 254 tx = tx.Model(&ms).Select("max(id) id", "max(author_id) author_id", "max(created_at) created_at").
255 Where("company_id=?", companyId). 255 Where("company_id=?", companyId).
256 Where("author_id in (?)", authors). 256 Where("author_id in (?)", authors).
257 - Where("target_user=0 or who_read @>'[?]'", whoRead). 257 + Where("target_user=0 or who_read @>? ", fmt.Sprintf("[%d]", whoRead)).
258 Where("show = 1"). 258 Where("show = 1").
259 Where("id not in (select article_id from user_read_article where user_id = ?)", whoRead). 259 Where("id not in (select article_id from user_read_article where user_id = ?)", whoRead).
260 Group("author_id"). 260 Group("author_id").