新增了题库2、3类型1
This commit is contained in:
@@ -91,6 +91,15 @@ func (r *QuestionQaItemDao) GetQuestionQaItemPreloadList(maps interface{}) (m []
|
||||
return m, nil
|
||||
}
|
||||
|
||||
// GetQuestionQaItemPreloadListRand 获取列表-加载全部关联-随机
|
||||
func (r *QuestionQaItemDao) GetQuestionQaItemPreloadListRand(maps interface{}) (m []*model.QuestionQaItem, err error) {
|
||||
err = global.Db.Preload(clause.Associations).Where(maps).Order("rand()").Find(&m).Error
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
|
||||
// GetQuestionQaItemListRand 获取列表-随机
|
||||
func (r *QuestionQaItemDao) GetQuestionQaItemListRand(maps interface{}, limit int) (m []*model.QuestionQaItem, err error) {
|
||||
err = global.Db.Where(maps).Limit(limit).Order("rand()").Find(&m).Error
|
||||
|
||||
Reference in New Issue
Block a user