diff --git a/api/service/Question.go b/api/service/Question.go index afe8ea0..d0fc4ad 100644 --- a/api/service/Question.go +++ b/api/service/Question.go @@ -66,11 +66,13 @@ func (r *QuestionService) GetGuessUserLIkeList(userId int64) (m []*model.Questio } // 未参与过/未指定用户 - if len(questions) == 0 { + if len(questions) < 3 { + limit := 3 - len(questions) + maps := make(map[string]interface{}) maps["question_status"] = 1 maps["is_hide"] = 0 - questions, err = questionDao.GetQuestionListRand(maps, 3) + questions, err = questionDao.GetQuestionListRand(maps, limit) if err != nil { return nil, err }