This commit is contained in:
2024-10-09 16:40:59 +08:00
parent f862bd28e1
commit a8e0d18794
3 changed files with 12 additions and 18 deletions
+4 -4
View File
@@ -155,12 +155,12 @@ func (r *QuestionDao) GetQuestionPageSearch(req requests.GetQuestionPage, page,
query = query.Where("question_source = ?", req.QuestionSource)
// 一级标签id
if req.FirstLabelId != nil {
if req.FirstLabelId != "" {
query = query.Where("first_label_id = ?", req.FirstLabelId)
}
// 二级标签id
if req.SecondLabelId != nil {
if req.SecondLabelId != "" {
query = query.Where("second_label_id = ?", req.SecondLabelId)
}
@@ -242,12 +242,12 @@ func (r *QuestionDao) GetQuestionCountSearch(req requests.GetQuestionCount) (tot
}
// 一级标签id
if req.FirstLabelId != nil {
if req.FirstLabelId != "" {
query = query.Where("first_label_id = ?", req.FirstLabelId)
}
// 二级标签id
if req.SecondLabelId != nil {
if req.SecondLabelId != "" {
query = query.Where("second_label_id = ?", req.SecondLabelId)
}