|
@@ -34,21 +34,22 @@ func GetListTotalByUserIdCommunityQuestionID(userId uint64, communityQuestionID
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-// GetHotListByCommunityQuestionID 获取报告的精选留言列表
|
|
|
+// GetHotListByCommunityQuestionID 获取报告的精选留言列表(2022-08-23修改为获取所有留言, 不再精选)
|
|
|
func GetHotListByCommunityQuestionID(communityQuestionID int, offset, limit int) (list []*YbCommunityQuestionComment, err error) {
|
|
|
err = global.DEFAULT_MYSQL.Model(YbCommunityQuestionComment{}).
|
|
|
- Where("community_question_id = ? AND enabled = 1 AND is_hot = 1 AND type = 1", communityQuestionID).
|
|
|
- Order("is_top desc, hot_top_time desc, community_question_comment_id desc").
|
|
|
+ Where("community_question_id = ? AND enabled = 1 AND type = 1", communityQuestionID).
|
|
|
+ //Order("is_top desc, hot_top_time desc, community_question_comment_id desc").
|
|
|
+ Order("create_time DESC").
|
|
|
Offset(offset).
|
|
|
Limit(limit).
|
|
|
Scan(&list).Error
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-// GetHotListTotalByCommunityQuestionID 获取精选留言总条数
|
|
|
+// GetHotListTotalByCommunityQuestionID 获取精选留言总条数(2022-08-23修改为获取所有留言, 不再精选)
|
|
|
func GetHotListTotalByCommunityQuestionID(communityQuestionID int) (total int64, err error) {
|
|
|
err = global.DEFAULT_MYSQL.Model(YbCommunityQuestionComment{}).
|
|
|
- Where("community_question_id = ? AND enabled = 1 AND is_hot = 1 AND type = 1", communityQuestionID).
|
|
|
+ Where("community_question_id = ? AND enabled = 1 AND type = 1", communityQuestionID).
|
|
|
Count(&total).Error
|
|
|
return
|
|
|
}
|
|
@@ -128,10 +129,10 @@ func GetUserAvatarRandom() (item *UserAvatarRandom, err error) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-// GetHotListByCommunityQuestionIds 根据问答id列表获取精选留言-精选时间倒序
|
|
|
+// GetHotListByCommunityQuestionIds 根据问答id列表获取精选留言-精选时间倒序(2022-0823不再精选,获取所有评论)
|
|
|
func GetHotListByCommunityQuestionIds(communityQuestionIds []uint32) (items []*YbCommunityQuestionComment, err error) {
|
|
|
err = global.DEFAULT_MYSQL.Model(YbCommunityQuestionComment{}).
|
|
|
- Where("community_question_id IN (?) AND enabled = 1 AND is_hot = 1 AND type = 1", communityQuestionIds).
|
|
|
+ Where("community_question_id IN (?) AND enabled = 1 AND type = 1", communityQuestionIds).
|
|
|
Order("hot_time DESC").
|
|
|
Find(&items).Error
|
|
|
return
|