浏览代码

Merge branch 'mfyx_3.6' of http://8.136.199.33:3000/cxzhang/hongze_web_mfyx into debug

xingzai 8 月之前
父节点
当前提交
3c5ba89aba
共有 3 个文件被更改,包括 5 次插入7 次删除
  1. 4 0
      controllers/home.go
  2. 0 6
      services/es_comprehensive.go
  3. 1 1
      services/resource_data.go

+ 4 - 0
controllers/home.go

@@ -326,6 +326,10 @@ func (this *MobileHomeController) NewList() {
 			if labelKeyword != utils.LABEL_L2_1 && labelKeyword != utils.LABEL_L2_2 {
 				condition += `  AND IF ( source = 'yanxuanspecial' , source_id   IN (0) ,1=1 ) `
 			}
+			//如果不是全部活动,就不展示对应的音视频
+			if labelKeyword != utils.LABEL_L1_1 {
+				condition += `   AND source  NOT IN ('activityvoice','activityvideo') `
+			}
 		}
 
 		yanxuanArticleIds = append(yanxuanArticleIds, 0)

+ 0 - 6
services/es_comprehensive.go

@@ -636,11 +636,7 @@ func SqlComprehensiveSearch(user *models.WxUserItem, keyWord string, startSize,
 	var searchTotal int
 	searchTotal = (startSize/pageSize + 1) * pageSize
 	var list []*models.CygxResourceData
-	fmt.Println("totalTitle", totalTitle)
-	fmt.Println("totalContent", totalContent)
-	fmt.Println(searchTotal)
 	if totalTitle >= searchTotal {
-		fmt.Println("1")
 		//全部都是标题搜索
 		list, e = models.GetResourceDataAndYanxuanSpecialAuthorListCondition(conditionTitle, parsTitle, conditionContentYxAuthor, parsContentYxAuthor, startSize, pageSize)
 		if e != nil && e.Error() != utils.ErrNoRow() {
@@ -648,7 +644,6 @@ func SqlComprehensiveSearch(user *models.WxUserItem, keyWord string, startSize,
 			return
 		}
 	} else if totalTitle <= searchTotal-pageSize {
-		fmt.Println("2")
 		//全部都是内容搜索
 		startSize = startSize - totalTitle
 
@@ -658,7 +653,6 @@ func SqlComprehensiveSearch(user *models.WxUserItem, keyWord string, startSize,
 			return
 		}
 	} else {
-		fmt.Println("3")
 		//一半标题搜索,一半内容搜索
 
 		//list, e = models.GetResourceDataListCondition(conditionTitle, parsTitle, startSize, pageSize)

+ 1 - 1
services/resource_data.go

@@ -267,7 +267,7 @@ func GetResourceDataList(condition string, pars []interface{}, startSize, pageSi
 	for _, vList := range list {
 		for _, v := range mapItems {
 			//如果这些类型都为空,那么就不合并
-			if v.Article == nil && v.Newchart == nil && v.Roadshow == nil && v.Activity == nil && v.Activityvideo == nil && v.Activityvoice == nil && v.YanxuanSpecial == nil && v.AskserieVideo == nil {
+			if v.Article == nil && v.Activity == nil && v.Activityvideo == nil && v.Activityvoice == nil && v.YanxuanSpecial == nil {
 				continue
 			}
 			if v.SourceId == vList.SourceId && v.Source == vList.Source {