Sfoglia il codice sorgente

问题模糊查询

zk 2 anni fa
parent
commit
3aae44d6d1
1 ha cambiato i file con 3 aggiunte e 0 eliminazioni
  1. 3 0
      server/service/autocode/problem_type.go

+ 3 - 0
server/service/autocode/problem_type.go

@@ -61,6 +61,9 @@ func (problemTypeService *ProblemTypeService) GetProblemTypeInfoList(info autoCo
 	if info.SiteType != nil {
 		db.Where("site_type = ?", info.SiteType)
 	}
+	if info.Problem != "" {
+		db.Where("problem like ?", "%"+info.Problem+"%")
+	}
 	var problemTypes []autocode.ProblemType
 	// 如果有条件搜索 下方会自动创建搜索语句
 	err = db.Count(&total).Error