|
@@ -98,7 +98,7 @@ type NumCommentByCommunityQuestion struct {
|
|
|
func GetNumCommentByCommunityQuestionIds(communityQuestionIds []uint32) (item []*NumCommentByCommunityQuestion, err error) {
|
|
|
err = global.DEFAULT_MYSQL.Model(YbCommunityQuestionComment{}).
|
|
|
Select("community_question_id, count(1) total").
|
|
|
- Where("community_question_id in (?) and type=1 and enabled = 1 ", communityQuestionIds).Scan(&item).Error
|
|
|
+ Where("community_question_id in (?) and type=1 and enabled = 1 ", communityQuestionIds).Group("community_question_id").Scan(&item).Error
|
|
|
return
|
|
|
}
|
|
|
|