Browse Source

查询一级分类下的报告

xiexiaoyuan 2 years ago
parent
commit
f0a775a3d4
2 changed files with 4 additions and 4 deletions
  1. 2 2
      controller/english_report/english_report.go
  2. 2 2
      models/english_report/report.go

+ 2 - 2
controller/english_report/english_report.go

@@ -40,11 +40,11 @@ func (er *EnglishReportController) List(c *gin.Context) {
 	var tmpList []*english_report.Report
 	var list []*english_report.ReportListItem
 
-	if req.ClassifyIdFirst != "" {
+	if req.ClassifyIdFirst >0 {
 		condition += " and classify_id_first = ?"
 		pars = append(pars, req.ClassifyIdFirst)
 	}
-	if req.ClassifyIdSecond != "" {
+	if req.ClassifyIdSecond >0 {
 		condition += " and classify_id_second = ?"
 		pars = append(pars, req.ClassifyIdSecond)
 	}

+ 2 - 2
models/english_report/report.go

@@ -42,8 +42,8 @@ func (r *Report) TableName() string {
 }
 
 type ReportListReq struct {
-	ClassifyIdFirst  string `json:"classify_id_first" form:"classify_id_first"`
-	ClassifyIdSecond string `json:"classify_id_second" form:"classify_id_second"`
+	ClassifyIdFirst  int `json:"classify_id_first" form:"classify_id_first"`
+	ClassifyIdSecond int `json:"classify_id_second" form:"classify_id_second"`
 	base.PageReq
 }