Bläddra i källkod

fix:列表筛选

zqbao 7 månader sedan
förälder
incheckning
9f94cb2873
2 ändrade filer med 5 tillägg och 5 borttagningar
  1. 4 4
      controllers/report_push_status.go
  2. 1 1
      models/report_push_status.go

+ 4 - 4
controllers/report_push_status.go

@@ -88,7 +88,7 @@ func (this *ReportPushStatusController) List() {
 		pars = append(pars, publishEndDateStr)
 	}
 	if pushStartDate != "" && pushEndDate != "" {
-		condition += " AND push_time >= ?"
+		condition += " AND push_time >= ? "
 		pushStartTime, err := time.Parse(utils.FormatDate, pushStartDate)
 		if err != nil {
 			br.Msg = "日期格式有误"
@@ -98,7 +98,7 @@ func (this *ReportPushStatusController) List() {
 		pushStartDateStr := pushStartTime.Format(utils.FormatDateTime)
 		pars = append(pars, pushStartDateStr)
 
-		condition += " AND push_time <= ?"
+		condition += " AND push_time <= ? "
 		pushEndTime, err := time.Parse(utils.FormatDate, pushEndDate)
 		if err != nil {
 			br.Msg = "日期格式有误"
@@ -190,7 +190,7 @@ func (this *ReportPushStatusController) List() {
 			selectIdStrs := strings.Split(selectedIds, ",")
 			if len(selectIdStrs) > 0 {
 				condition += ` AND report_id NOT IN (` + utils.GetOrmReplaceHolder(len(selectIdStrs)) + `)`
-				pars = append(pars, selectedIds)
+				pars = append(pars, selectIdStrs)
 			}
 		}
 	} else {
@@ -198,7 +198,7 @@ func (this *ReportPushStatusController) List() {
 			selectIdStrs := strings.Split(selectedIds, ",")
 			if len(selectIdStrs) > 0 {
 				condition += ` AND report_id IN (` + utils.GetOrmReplaceHolder(len(selectIdStrs)) + `)`
-				pars = append(pars, selectedIds)
+				pars = append(pars, selectIdStrs)
 			}
 		}
 	}

+ 1 - 1
models/report_push_status.go

@@ -118,7 +118,7 @@ func GetReportPushStatusListByCondition(condition string, pars []interface{}, st
 	if condition != "" {
 		sql += condition
 	}
-	sql += `LIMIT ?,? `
+	sql += ` LIMIT ?,? `
 	_, err = o.Raw(sql, pars, startSize, pageSize).QueryRows(&items)
 	return
 }