Selaa lähdekoodia

fix:调整报告视频关联分类列表的接口,支持返回三级

Roc 8 kuukautta sitten
vanhempi
commit
3fd27dc5a6
1 muutettua tiedostoa jossa 5 lisäystä ja 3 poistoa
  1. 5 3
      controllers/yb/road_video.go

+ 5 - 3
controllers/yb/road_video.go

@@ -533,18 +533,20 @@ func (r *RoadVideoController) SimpleReportList() {
 			}
 		}
 		if hasChild {
+			classifyCondList := make([]string, 0)
 			if len(firstClassifyIds) > 0 {
-				cond += ` AND classify_id_first IN ( ` + utils.GetOrmInReplace(len(firstClassifyIds)) + ` ) `
+				classifyCondList = append(classifyCondList, ` classify_id_first IN ( `+utils.GetOrmInReplace(len(firstClassifyIds))+` ) `)
 				pars = append(pars, firstClassifyIds)
 			}
 			if len(secondClassifyIds) > 0 {
-				cond += ` AND classify_id_second IN ( ` + utils.GetOrmInReplace(len(secondClassifyIds)) + ` ) `
+				classifyCondList = append(classifyCondList, ` classify_id_second IN ( `+utils.GetOrmInReplace(len(secondClassifyIds))+` ) `)
 				pars = append(pars, secondClassifyIds)
 			}
 			if len(thirdClassifyIds) > 0 {
-				cond += ` AND classify_id_third IN ( ` + utils.GetOrmInReplace(len(thirdClassifyIds)) + ` ) `
+				classifyCondList = append(classifyCondList, ` classify_id_third IN ( `+utils.GetOrmInReplace(len(thirdClassifyIds))+` ) `)
 				pars = append(pars, thirdClassifyIds)
 			}
+			cond += fmt.Sprintf(` AND (%s) `, strings.Join(classifyCondList, " OR "))
 		} else {
 			cond += ` AND 1 = 2`
 		}