浏览代码

no message

xingzai 1 年之前
父节点
当前提交
4acc1e4cbb
共有 1 个文件被更改,包括 0 次插入234 次删除
  1. 0 234
      controllers/home.go

+ 0 - 234
controllers/home.go

@@ -296,208 +296,6 @@ func (this *MobileHomeController) NewList() {
 	var err error
 	resp := new(models.HomeResourceDataListNewResp)
 
-	//var articleTypes, activityTypes, industries, subjectNames string
-	//articleTypeCondSlice := make([]string, 0)
-	//activityTypesCondSlice := make([]string, 0)
-	//industriesCondSlice := make([]string, 0)
-	//subjectNamesSlice := make([]string, 0)
-	//articleTypeSlice := make([]string, 0)
-	//if tagIds != "" {
-	//	tags := strings.Split(tagIds, ",")
-	//	for _, tagIdStr := range tags {
-	//		tagId, err := strconv.Atoi(tagIdStr)
-	//		if err != nil {
-	//			br.Msg = "转换失败"
-	//			br.ErrMsg = "tagid转换失败,Err:" + err.Error()
-	//			return
-	//		}
-	//		tagInfo, err := models.GetCygxTagByTagId(tagId)
-	//		if err != nil && err.Error() != utils.ErrNoRow() {
-	//			br.Msg = "获取失败"
-	//			br.ErrMsg = "GetCygxTagByTagId,Err:" + err.Error()
-	//			return
-	//		}
-	//		// 只有AB或CD的情况
-	//		if (tagInfo.ActivityTypes == "" && tagInfo.ArticleTypes == "") || (tagInfo.Industries == "" && tagInfo.SubjectNames == "") {
-	//			if tagInfo.ActivityTypes != "" {
-	//				activityTypes += tagInfo.ActivityTypes + ","
-	//			}
-	//			if tagInfo.ArticleTypes != "" {
-	//				articleTypes += tagInfo.ArticleTypes + ","
-	//			}
-	//			if tagInfo.Industries != "" {
-	//				industries += tagInfo.Industries + ","
-	//			}
-	//			if tagInfo.SubjectNames != "" {
-	//				subjectNames += tagInfo.SubjectNames + ","
-	//			}
-	//		} else {
-	//			// ABCD都有的情况
-	//			// 每一个tag都单独处理
-	//			var articleType, activityType, industry, subjectName string
-	//
-	//			if tagInfo.ActivityTypes != "" {
-	//				activityType = tagInfo.ActivityTypes
-	//			}
-	//			if tagInfo.ArticleTypes != "" {
-	//				articleType = tagInfo.ArticleTypes
-	//			}
-	//			if tagInfo.Industries != "" {
-	//				industry = tagInfo.Industries
-	//			}
-	//			if tagInfo.SubjectNames != "" {
-	//				subjectName = tagInfo.SubjectNames
-	//			}
-	//			articleTypeCond := ``
-	//			var articleTypeStr string
-	//			if articleType != "" {
-	//				articleTypeSlice := strings.Split(articleType, ",")
-	//				newArticleTypeSlice := make([]string, 0)
-	//				for _, s := range articleTypeSlice {
-	//					newArticleTypeSlice = append(newArticleTypeSlice, "'"+s+"'")
-	//				}
-	//				articleTypeStr = strings.Join(newArticleTypeSlice, ",")
-	//				articleTypeStr = strings.TrimRight(articleTypeStr, ",")
-	//				articleTypeCond += ` AND (art.sub_category_name In (` + articleTypeStr + `) OR (art.article_type_name In (` + articleTypeStr + `) AND art.article_type_name <> '路演精华' AND art.article_type_id <> 0 ) ) `
-	//			}
-	//			activityTypesCond := ``
-	//			if activityType != "" {
-	//				activityTypeSlice := strings.Split(activityType, ",")
-	//				newActivityTypeSlice := make([]string, 0)
-	//				for _, s := range activityTypeSlice {
-	//					newActivityTypeSlice = append(newActivityTypeSlice, "'"+s+"'")
-	//				}
-	//				activityTypeStr := strings.Join(newActivityTypeSlice, ",")
-	//				activityTypeStr = strings.TrimRight(activityTypeStr, ",")
-	//				activityTypesCond += ` AND act.activity_type_name In (` + activityTypeStr + `) `
-	//			}
-	//			industriesCond := ``
-	//			var industryStr string
-	//			if industry != "" {
-	//				industrieSlice := strings.Split(industry, ",")
-	//				newIndustrieSlice := make([]string, 0)
-	//				for _, s := range industrieSlice {
-	//					newIndustrieSlice = append(newIndustrieSlice, "'"+s+"'")
-	//				}
-	//				industryStr = strings.Join(newIndustrieSlice, ",")
-	//				industryStr = strings.TrimRight(industryStr, ",")
-	//				industriesCond += ` AND im.industry_name In (` + industryStr + `) `
-	//			}
-	//			subjectNamesCond := ``
-	//			var subjectNameStr string
-	//			if subjectName != "" {
-	//				subjectNameSlice := strings.Split(subjectName, ",")
-	//				newSubjectNameSlice := make([]string, 0)
-	//				for _, s := range subjectNameSlice {
-	//					newSubjectNameSlice = append(newSubjectNameSlice, "'"+s+"'")
-	//				}
-	//				subjectNameStr = strings.Join(newSubjectNameSlice, ",")
-	//				subjectNameStr = strings.TrimRight(subjectNameStr, ",")
-	//				subjectNamesCond += ` AND cis.subject_name In (` + subjectNameStr + `) `
-	//			}
-	//			articleTypeCondSlice = append(articleTypeCondSlice, articleTypeCond)
-	//			activityTypesCondSlice = append(activityTypesCondSlice, activityTypesCond)
-	//			industriesCondSlice = append(industriesCondSlice, industryStr)
-	//			subjectNamesSlice = append(subjectNamesSlice, subjectNameStr)
-	//			articleTypeSlice = append(articleTypeSlice, articleType)
-	//		}
-	//
-	//	}
-	//}
-	//
-	//// 先拿abdc都有的tag取合集的ids。。。
-	//soloTagArticleIds, soloTagActivityIds, soloMmIds, err := models.GetCygxCygxArticleListByConditionSoloTag(articleTypeCondSlice, activityTypesCondSlice, industriesCondSlice, subjectNamesSlice, articleTypeSlice)
-	//if err != nil && err.Error() != utils.ErrNoRow() {
-	//	br.Msg = "获取失败"
-	//	br.ErrMsg = "获取活动权限数据失败,Err:" + err.Error()
-	//	return
-	//}
-	//
-	//articleTypes = strings.TrimRight(articleTypes, ",")
-	//activityTypes = strings.TrimRight(activityTypes, ",")
-	//industries = strings.TrimRight(industries, ",")
-	//subjectNames = strings.TrimRight(subjectNames, ",")
-	//
-	//articleTypesCond := ``
-	//var articleTypeStr string
-	//if articleTypes != "" {
-	//	articleTypeSlice := strings.Split(articleTypes, ",")
-	//	newArticleTypeSlice := make([]string, 0)
-	//	for _, s := range articleTypeSlice {
-	//		newArticleTypeSlice = append(newArticleTypeSlice, "'"+s+"'")
-	//	}
-	//	articleTypeStr = strings.Join(newArticleTypeSlice, ",")
-	//	articleTypeStr = strings.TrimRight(articleTypeStr, ",")
-	//	articleTypesCond += ` AND (art.sub_category_name In (` + articleTypeStr + `) OR (art.article_type_name In (` + articleTypeStr + `) AND art.article_type_name <> '路演精华' AND art.article_type_id <> 0 ) ) `
-	//}
-	//activityTypesCond := ``
-	//if activityTypes != "" {
-	//	activityTypeSlice := strings.Split(activityTypes, ",")
-	//	newActivityTypeSlice := make([]string, 0)
-	//	for _, s := range activityTypeSlice {
-	//		newActivityTypeSlice = append(newActivityTypeSlice, "'"+s+"'")
-	//	}
-	//	activityTypeStr := strings.Join(newActivityTypeSlice, ",")
-	//	activityTypeStr = strings.TrimRight(activityTypeStr, ",")
-	//	activityTypesCond += ` AND act.activity_type_name In (` + activityTypeStr + `) `
-	//}
-	//industriesCond := ``
-	//var industryStr string
-	//if industries != "" {
-	//	industrieSlice := strings.Split(industries, ",")
-	//	newIndustrieSlice := make([]string, 0)
-	//	for _, s := range industrieSlice {
-	//		newIndustrieSlice = append(newIndustrieSlice, "'"+s+"'")
-	//	}
-	//	industryStr = strings.Join(newIndustrieSlice, ",")
-	//	industryStr = strings.TrimRight(industryStr, ",")
-	//	industriesCond += ` AND im.industry_name In (` + industryStr + `) `
-	//}
-	//subjectNamesCond := ``
-	//var subjectNameStr string
-	//if subjectNames != "" {
-	//	subjectNameSlice := strings.Split(subjectNames, ",")
-	//	newSubjectNameSlice := make([]string, 0)
-	//	for _, s := range subjectNameSlice {
-	//		newSubjectNameSlice = append(newSubjectNameSlice, "'"+s+"'")
-	//	}
-	//	subjectNameStr = strings.Join(newSubjectNameSlice, ",")
-	//	subjectNameStr = strings.TrimRight(subjectNameStr, ",")
-	//	subjectNamesCond += ` AND cis.subject_name In (` + subjectNameStr + `) `
-	//}
-	//
-	//var tagArticleIds, tagActivityIds, mmIds string
-	//if articleTypesCond != "" || activityTypesCond != "" || industryStr != "" || subjectNameStr != "" {
-	//	tagArticleIds, tagActivityIds, mmIds, err = models.GetCygxCygxArticleListByCondition(articleTypesCond, activityTypesCond, industryStr, subjectNameStr, articleTypeStr)
-	//	if err != nil && err.Error() != utils.ErrNoRow() {
-	//		br.Msg = "获取失败"
-	//		br.ErrMsg = "获取单个标签ids失败,Err:" + err.Error()
-	//		return
-	//	}
-	//}
-	//
-	//if soloTagArticleIds != "" {
-	//	if tagArticleIds != "" {
-	//		tagArticleIds += "," + soloTagArticleIds
-	//	} else {
-	//		tagArticleIds = soloTagArticleIds
-	//	}
-	//}
-	//if soloTagActivityIds != "" {
-	//	if tagActivityIds != "" {
-	//		tagActivityIds += "," + soloTagActivityIds
-	//	} else {
-	//		tagActivityIds = soloTagActivityIds
-	//	}
-	//}
-	//if soloMmIds != "" {
-	//	if mmIds != "" {
-	//		mmIds += "," + soloMmIds
-	//	} else {
-	//		mmIds = soloMmIds
-	//	}
-	//}
-
 	if tagIds != "" {
 		conditionTagIdsInit, err := services.GetConditionInitByTagIds(tagIds)
 		if err != nil {
@@ -565,38 +363,6 @@ func (this *MobileHomeController) NewList() {
 		}
 		lenActivityspecialIds := len(activityspecialIds)
 
-		//if tagIds != "" {
-		//	if tagArticleIds != "" {
-		//		condition = ` AND ((source = 'article' AND source_id IN (` + tagArticleIds + `) ) `
-		//		if mmIds != "" {
-		//			condition += ` OR ( source = 'meetingreviewchapt' AND source_id IN (` + mmIds + `) )   `
-		//		}
-		//		if tagActivityIds != "" && lenActivityIds > 0 {
-		//			condition += ` OR (source = 'activity' AND source_id IN (` + tagActivityIds + `) AND source_id IN (` + utils.GetOrmInReplace(lenActivityIds) + `) )) `
-		//			pars = append(pars, activityIds)
-		//		} else {
-		//			// 无可见活动
-		//			condition += ` OR (source = 'activity' AND source_id IN (0))) `
-		//		}
-		//	} else if tagActivityIds != "" {
-		//		condition = ` AND ((source = 'article' AND source_id IN (0))  `
-		//		if mmIds != "" {
-		//			condition += ` OR ( source = 'meetingreviewchapt' AND source_id IN (` + mmIds + `) )   `
-		//		}
-		//		if tagActivityIds != "" && lenActivityIds > 0 {
-		//			condition += ` OR (source = 'activity' AND source_id IN (` + tagActivityIds + `) AND source_id IN (` + utils.GetOrmInReplace(lenActivityIds) + `))) `
-		//			pars = append(pars, activityIds)
-		//		} else {
-		//			// 无可见活动
-		//			condition += ` OR (source = 'activity' AND source_id IN (0))) `
-		//		}
-		//	} else if mmIds != "" {
-		//		condition = ` AND ( source = 'meetingreviewchapt' AND source_id IN (` + mmIds + `) )   `
-		//	} else {
-		//		condition += ` AND ((source = 'article' AND source_id IN (0)) OR (source = 'activity' AND source_id IN (0))) `
-		//	}
-		//}
-
 		//if lenActivityIds > 0 && tagIds == "" {
 		if lenActivityIds > 0 {
 			condition += ` OR ( source = 'activity' AND source_id IN (` + utils.GetOrmInReplace(lenActivityIds) + `) ` + conditionInit + ` )    `