diff --git a/api/dao/Question.go b/api/dao/Question.go index 8e89d66..6a99a2f 100644 --- a/api/dao/Question.go +++ b/api/dao/Question.go @@ -251,3 +251,23 @@ func (r *QuestionDao) GetQuestionCountSearch(req requests.GetQuestionCount) (tot return totalRecords, nil } + +// +//// GetQuestionNotInListRand 获取列表-随机-排除 +//func (r *QuestionDao) GetQuestionNotInListRand(maps interface{}, notQuestionId []int64, limit int) (m []*model.Question, err error) { +// query := global.Db.Model(&model.Question{}) +// query = query.Where(maps) +// +// // 排除选项 +// if len(notQuestionId) > 0 { +// query = query.Where("question_id not in (?)", notQuestionId) +// } +// +// query = query.Limit(limit).Order("rand()") +// +// err = query.Find(&m).Error +// if err != nil { +// return nil, err +// } +// return m, nil +//}