Sfoglia il codice sorgente

消息推送规律重复user_id

kobe6258 8 mesi fa
parent
commit
0ddfaee495
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      models/user/user_analyst_follow_list.go

+ 1 - 1
models/user/user_analyst_follow_list.go

@@ -32,7 +32,7 @@ type UserAnalystFollowList struct {
 
 func GetPostUser(authorName string, PublishTime string) (ids []int) {
 	db := models.Main()
-	err := db.Model(&UserAnalystFollowList{}).Select("user_id").Where("financial_analyst_name = ? and followed = ? and followed_time <=Date(?)", authorName, Following, PublishTime).Order("id asc").Find(&ids).Error
+	err := db.Model(&UserAnalystFollowList{}).Select("distinct user_id").Where("financial_analyst_name = ? and followed = ? and followed_time <=Date(?)", authorName, Following, PublishTime).Order("id asc").Find(&ids).Error
 	if err != nil {
 		return []int{}
 	}