WH01243 1 éve
szülő
commit
5d1e44187f
1 módosított fájl, 5 hozzáadás és 4 törlés
  1. 5 4
      src/jfw/modules/bigmember/src/entity/report.go

+ 5 - 4
src/jfw/modules/bigmember/src/entity/report.go

@@ -75,13 +75,14 @@ func GetReportProjectInfo(param *ReportProjectInfoParam, positionId int64) (data
 		// 行业 {"水利水电":["水利工程","发电工程","航运工程","其他工程"]} sql中处理成 "水利水电_水利工程"
 		tmpArr := []string{}
 		for topIndustry, subList := range param.Industry {
-			for i := 0; i < len(subList); i++ {
-				tmpArr = append(tmpArr, "find_in_set(?,subscopeclass)")
-				values = append(values, fmt.Sprintf("%s_%s", topIndustry, subList[i]))
-			}
 			if param.From == From {
 				tmpArr = append(tmpArr, "find_in_set(?,subscopeclass)")
 				values = append(values, topIndustry)
+			} else {
+				for i := 0; i < len(subList); i++ {
+					tmpArr = append(tmpArr, "find_in_set(?,subscopeclass)")
+					values = append(values, fmt.Sprintf("%s_%s", topIndustry, subList[i]))
+				}
 			}
 		}
 		qstr = append(qstr, fmt.Sprintf("(%s)", strings.Join(tmpArr, " or ")))