From 4e529ecb7faa0548dd509a926347ff1629f82c79 Mon Sep 17 00:00:00 2001 From: wucongxing8150 <815046773@qq.com> Date: Wed, 20 Nov 2024 18:24:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BA=86=E4=B8=80=E6=AE=B5?= =?UTF-8?q?=E6=B3=A8=E9=87=8A=E4=BB=A3=E7=A0=81=E3=80=82=E6=8E=92=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/dao/Question.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) 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 +//}