From 8d418d567a0c54a6870804337095d3ea4a5d9f9e Mon Sep 17 00:00:00 2001 From: wucongxing8150 <815046773@qq.com> Date: Mon, 21 Oct 2024 15:26:03 +0800 Subject: [PATCH] 44 --- api/dao/QuestionQaItem.go | 4 ++-- api/requests/QuestionQaItem.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/api/dao/QuestionQaItem.go b/api/dao/QuestionQaItem.go index d2b7c81..225a96a 100644 --- a/api/dao/QuestionQaItem.go +++ b/api/dao/QuestionQaItem.go @@ -179,7 +179,7 @@ func (r *QuestionQaItemDao) GetQuestionQaItemPageSearch(req requests.GetQuestion } // 一级标签id - if req.FirstLabelId != nil { + if req.FirstLabelId != "" { subQuery := global.Db.Model(&model.Question{}). Select("question_id"). Where("first_label_id = ?", req.FirstLabelId) @@ -188,7 +188,7 @@ func (r *QuestionQaItemDao) GetQuestionQaItemPageSearch(req requests.GetQuestion } // 二级标签id - if req.SecondLabelId != nil { + if req.SecondLabelId != "" { subQuery := global.Db.Model(&model.Question{}). Select("question_id"). Where("second_label_id = ?", req.SecondLabelId) diff --git a/api/requests/QuestionQaItem.go b/api/requests/QuestionQaItem.go index 5dd4966..70aadfa 100644 --- a/api/requests/QuestionQaItem.go +++ b/api/requests/QuestionQaItem.go @@ -17,8 +17,8 @@ type GetQuestionQaItemPage struct { QuestionType *int `json:"question_type" form:"question_type" validate:"omitempty,oneof=1 2 3 4" label:"题目类型"` // 题目类型(1:单选 2:多选 3:问答 4:判断) QuestionSource *int `json:"question_source" form:"question_source" validate:"omitempty,oneof=1 2" label:"题目来源"` // 题目来源(1:本题库 2:外部数据) Difficulty *int `json:"difficulty" form:"difficulty" label:"难度"` - FirstLabelId *string `json:"first_label_id" form:"first_label_id" label:"一级标签id"` - SecondLabelId *string `json:"second_label_id" form:"second_label_id" label:"二级标签id"` + FirstLabelId string `json:"first_label_id" form:"first_label_id" label:"一级标签id"` + SecondLabelId string `json:"second_label_id" form:"second_label_id" label:"二级标签id"` Order *GetQuestionQaItemPageOrder `json:"order" form:"order" label:"排序"` }