Selaa lähdekoodia

Merge branch 'feature/web_english_report' into debug

xiexiaoyuan 2 vuotta sitten
vanhempi
commit
027318acd3
1 muutettua tiedostoa jossa 8 lisäystä ja 8 poistoa
  1. 8 8
      controllers/english_report.go

+ 8 - 8
controllers/english_report.go

@@ -194,8 +194,8 @@ func (this *EnglishReportController) ListReport() {
 
 	pageSize, _ := this.GetInt("PageSize")
 	currentIndex, _ := this.GetInt("CurrentIndex")
-	classifyNameFirst := this.GetString("ClassifyNameFirst")
-	classifyNameSecond := this.GetString("ClassifyNameSecond")
+	classifyIdFirst,_ := this.GetInt("ClassifyIdFirst")
+	classifyIdSecond,_ := this.GetInt("ClassifyIdSecond")
 
 	var startSize int
 	if pageSize <= 0 {
@@ -209,14 +209,14 @@ func (this *EnglishReportController) ListReport() {
 	var condition string
 	var pars []interface{}
 
-	if classifyNameFirst != "" {
-		condition += ` AND classify_name_first = ? `
-		pars = append(pars, classifyNameFirst)
+	if classifyIdFirst > 0 {
+		condition += ` AND classify_id_first = ? `
+		pars = append(pars, classifyIdFirst)
 	}
 
-	if classifyNameSecond != "" {
-		condition += ` AND classify_name_second = ? `
-		pars = append(pars, classifyNameSecond)
+	if classifyIdSecond > 0 {
+		condition += ` AND classify_id_second = ? `
+		pars = append(pars, classifyIdSecond)
 	}
 
 	total, err := models.GetEnglishReportListCount(condition, pars)