瀏覽代碼

Merge branch 'cygx_9.1' of http://8.136.199.33:3000/hongze/hongze_cygx into debug

xingzai 2 年之前
父節點
當前提交
4742879eac
共有 1 個文件被更改,包括 29 次插入27 次删除
  1. 29 27
      controllers/activity.go

+ 29 - 27
controllers/activity.go

@@ -2588,39 +2588,41 @@ func (this *ActivityCoAntroller) ActivityListNew() {
 		return
 		return
 	}
 	}
 
 
-	keyWordArr, err := services.GetIndustryMapNameSliceV3(keyWord)
-	if err != nil {
-		br.Msg = "获取失败"
-		br.ErrMsg = "获取分词失败,GetIndustryMapNameSliceV3 Err: " + err.Error()
-		return
-	}
-	keyWordArr = services.RemoveDuplicatesAndEmpty(keyWordArr)
-
-	startSizeIk := utils.StartIndex(currentIndex, pageSize)
-	startSizeIk = startSizeIk - total
-	if startSizeIk < 0 {
-		startSizeIk = 0
-	}
-	var pageSizeIk int
-	pageSizeIk = pageSize - len(list)
-	if pageSizeIk > 0 {
-		//搜索关键词联想
-		conditionActivityIk, err := services.GetActivityonditionList(user, activityTypeId, chartPermissionIds, whichDay, activeState, label, 0, source, keyWord, playBack, 2)
+	if keyWord != "" {
+		keyWordArr, err := services.GetIndustryMapNameSliceV3(keyWord)
 		if err != nil {
 		if err != nil {
 			br.Msg = "获取失败"
 			br.Msg = "获取失败"
-			br.ErrMsg = "获取失败,Err:" + err.Error()
+			br.ErrMsg = "获取分词失败,GetIndustryMapNameSliceV3 Err: " + err.Error()
 			return
 			return
 		}
 		}
-		conditionActivityIk += condition + conditionOrder
-		listIk, errList := models.GetActivityListNew(conditionActivityIk, pars, uid, startSizeIk, pageSizeIk, playBack, filter, typeName)
-		if errList != nil {
-			br.Msg = "获取失败"
-			br.ErrMsg = "获取失败,Err:" + errList.Error()
-			return
+		keyWordArr = services.RemoveDuplicatesAndEmpty(keyWordArr)
+
+		startSizeIk := utils.StartIndex(currentIndex, pageSize)
+		startSizeIk = startSizeIk - total
+		if startSizeIk < 0 {
+			startSizeIk = 0
 		}
 		}
+		var pageSizeIk int
+		pageSizeIk = pageSize - len(list)
+		if pageSizeIk > 0 {
+			//搜索关键词联想
+			conditionActivityIk, err := services.GetActivityonditionList(user, activityTypeId, chartPermissionIds, whichDay, activeState, label, 0, source, keyWord, playBack, 2)
+			if err != nil {
+				br.Msg = "获取失败"
+				br.ErrMsg = "获取失败,Err:" + err.Error()
+				return
+			}
+			conditionActivityIk += condition + conditionOrder
+			listIk, errList := models.GetActivityListNew(conditionActivityIk, pars, uid, startSizeIk, pageSizeIk, playBack, filter, typeName)
+			if errList != nil {
+				br.Msg = "获取失败"
+				br.ErrMsg = "获取失败,Err:" + errList.Error()
+				return
+			}
 
 
-		for _, item := range listIk {
-			list = append(list, item)
+			for _, item := range listIk {
+				list = append(list, item)
+			}
 		}
 		}
 	}
 	}