소스 검색

Merge branch 'master' of http://8.136.199.33:3000/cxzhang/hongze_clpt into cygx_9.4.0

xingzai 2 년 전
부모
커밋
e86f361ce3

+ 6 - 5
controllers/activity.go

@@ -51,7 +51,7 @@ func (this *ActivityController) LabelTypeList() {
 	condition += `AND art.activity_time > ?  `
 	condition += `AND art.activity_time > ?  `
 	pars = append(pars, time.Now().AddDate(0, -3, 0).Format(utils.FormatDate))
 	pars = append(pars, time.Now().AddDate(0, -3, 0).Format(utils.FormatDate))
 
 
-	conditionActivity, err := services.GetActivityonditionList(user, "", chartPermissionIds, whichDay, activeState, "", isPower, 0, "", 0)
+	conditionActivity, err := services.GetActivityonditionList(user, "", chartPermissionIds, whichDay, activeState, "", isPower, 0, "", 0, 1)
 	if err != nil && err.Error() != utils.ErrNoRow() {
 	if err != nil && err.Error() != utils.ErrNoRow() {
 		br.Msg = "获取失败"
 		br.Msg = "获取失败"
 		br.ErrMsg = "获取活动权限数据失败,Err:" + err.Error()
 		br.ErrMsg = "获取活动权限数据失败,Err:" + err.Error()
@@ -159,7 +159,7 @@ func (this *ActivityController) ActivityListNew() {
 	//mapDingActivityId := make(map[int]int)
 	//mapDingActivityId := make(map[int]int)
 	condition = ""
 	condition = ""
 	//活动可见限制
 	//活动可见限制
-	conditionActivity, err := services.GetActivityonditionList(user, activityTypeId, chartPermissionIds, whichDay, activeState, label, 0, source, keyWord, playBack)
+	conditionActivity, err := services.GetActivityonditionList(user, activityTypeId, chartPermissionIds, whichDay, activeState, label, 0, source, keyWord, playBack, 1)
 	if err != nil && err.Error() != utils.ErrNoRow() {
 	if err != nil && err.Error() != utils.ErrNoRow() {
 		br.Msg = "获取失败"
 		br.Msg = "获取失败"
 		br.ErrMsg = "获取活动权限数据失败,Err:" + err.Error()
 		br.ErrMsg = "获取活动权限数据失败,Err:" + err.Error()
@@ -195,7 +195,7 @@ func (this *ActivityController) ActivityListNew() {
 	}
 	}
 
 
 	condition += conditionOrder
 	condition += conditionOrder
-	list, errList := models.GetActivityListNew(condition, pars, uid, startSize, pageSize, playBack, filter)
+	list, errList := models.GetActivityListNew(condition, pars, uid, startSize, pageSize, playBack, filter, "")
 	if errList != nil {
 	if errList != nil {
 		br.Msg = "获取失败"
 		br.Msg = "获取失败"
 		br.ErrMsg = "获取失败,Err:" + errList.Error()
 		br.ErrMsg = "获取失败,Err:" + errList.Error()
@@ -1610,7 +1610,7 @@ func (this *ActivityController) ActivityListSearch() {
 	startSize = utils.StartIndex(currentIndex, pageSize)
 	startSize = utils.StartIndex(currentIndex, pageSize)
 	var condition string
 	var condition string
 	//活动可见限制
 	//活动可见限制
-	conditionActivity, err := services.GetActivityonditionList(user, "", "", "", "3", "", 0, 1, keyWord, playBack)
+	conditionActivity, err := services.GetActivityonditionList(user, "", "", "", "3", "", 0, 1, keyWord, playBack, 1)
 	if err != nil && err.Error() != utils.ErrNoRow() {
 	if err != nil && err.Error() != utils.ErrNoRow() {
 		br.Msg = "获取失败"
 		br.Msg = "获取失败"
 		br.ErrMsg = "获取活动权限数据失败,Err:" + err.Error()
 		br.ErrMsg = "获取活动权限数据失败,Err:" + err.Error()
@@ -1620,12 +1620,13 @@ func (this *ActivityController) ActivityListSearch() {
 		condition += ` AND art.yidong_activity_id = '' `
 		condition += ` AND art.yidong_activity_id = '' `
 	}
 	}
 	condition += ` AND art.is_limit_people = 1 AND art.publish_status = 1 ` + conditionActivity
 	condition += ` AND art.is_limit_people = 1 AND art.publish_status = 1 ` + conditionActivity
-	listActivity, total, err := services.GetActivitySpecialSearcheList(user, condition, startSize, pageSize, keyWord, playBack)
+	listActivity, total, err := services.GetActivitySpecialSearcheList(user, condition, startSize, pageSize, playBack, keyWord)
 	if err != nil {
 	if err != nil {
 		br.Msg = "获取失败"
 		br.Msg = "获取失败"
 		br.ErrMsg = "获取失败,Err:" + err.Error()
 		br.ErrMsg = "获取失败,Err:" + err.Error()
 		return
 		return
 	}
 	}
+	//return
 
 
 	//用户权限
 	//用户权限
 	authInfo, permissionArr, e := services.GetUserRaiPermissionInfo(user.UserId, user.CompanyId)
 	authInfo, permissionArr, e := services.GetUserRaiPermissionInfo(user.UserId, user.CompanyId)

+ 1 - 1
controllers/home.go

@@ -289,7 +289,7 @@ func (this *MobileHomeController) NewList() {
 		pageSize = utils.PageSize5
 		pageSize = utils.PageSize5
 	} else {
 	} else {
 		condition += ` AND source NOT IN ('activity','activityspecial','newchart') ` + conditionInit
 		condition += ` AND source NOT IN ('activity','activityspecial','newchart') ` + conditionInit
-		conditionActivity, err := services.GetActivityonditionList(user, "", "", "", "1,2,3", "", 0, 0, "", 0)
+		conditionActivity, err := services.GetActivityonditionList(user, "", "", "", "1,2,3", "", 0, 0, "", 0, 1)
 		if err != nil && err.Error() != utils.ErrNoRow() {
 		if err != nil && err.Error() != utils.ErrNoRow() {
 			br.Msg = "获取失败"
 			br.Msg = "获取失败"
 			br.ErrMsg = "获取活动权限数据失败,Err:" + err.Error()
 			br.ErrMsg = "获取活动权限数据失败,Err:" + err.Error()

+ 44 - 2
controllers/micro_roadshow.go

@@ -53,14 +53,56 @@ func (this *MicroRoadShowController) List() {
 	if currentIndex <= 0 {
 	if currentIndex <= 0 {
 		currentIndex = 1
 		currentIndex = 1
 	}
 	}
+	var keyWordArr []string
+	var err error
+	if keywords != "" {
+		keyWordArr, err = services.GetIndustryMapNameSliceV3(keywords)
+		if err != nil {
+			br.Msg = "获取失败"
+			br.ErrMsg = "获取分词失败,GetIndustryMapNameSliceV3 Err: " + err.Error()
+			return
+		}
+		keyWordArr = services.RemoveDuplicatesAndEmpty(keyWordArr)
+	}
+	var list []*models.MicroRoadShowPageList
+	var total int
+	var e error
 
 
 	// 微路演列表
 	// 微路演列表
-	list, total, e := services.GetMicroRoadShowPageListV8(pageSize, currentIndex, audioId, videoId, activityVideoId, filter, keywords)
+	list, total, e = services.GetMicroRoadShowPageListV8(pageSize, currentIndex, audioId, videoId, activityVideoId, filter, keywords)
 	if e != nil {
 	if e != nil {
 		br.Msg = "获取失败"
 		br.Msg = "获取失败"
 		br.ErrMsg = "获取微路演列表失败, Err: " + e.Error()
 		br.ErrMsg = "获取微路演列表失败, Err: " + e.Error()
 		return
 		return
 	}
 	}
+	var pageSizeIk int
+
+	//获取总的数量
+	totalIk, e := services.CountMicroRoadShowPageListIkWord(audioId, videoId, activityVideoId, keyWordArr, filter)
+	if e != nil {
+		br.Msg = "获取失败"
+		br.ErrMsg = "获取微路演联想词列表失败, Err: " + e.Error()
+		return
+	}
+	//return
+	pageSizeIk = totalIk - len(list)
+	//处理IK分词部分的分页获取条数
+	startSizeIk := utils.StartIndex(currentIndex, pageSize)
+	startSizeIk = startSizeIk - total
+	if startSizeIk < 0 {
+		startSizeIk = 0
+	}
+	if pageSizeIk > 0 {
+		lisIk, e := services.GetMicroRoadShowPageListIkWord(startSizeIk, pageSizeIk, audioId, videoId, activityVideoId, keyWordArr, filter, keywords)
+		if e != nil {
+			br.Msg = "获取失败"
+			br.ErrMsg = "获取微路演列表失败, Err: " + e.Error()
+			return
+		}
+		for _, item := range lisIk {
+			list = append(list, item)
+		}
+	}
 
 
 	// 用户权限
 	// 用户权限
 	authInfo, permissionArr, e := services.GetUserRaiPermissionInfo(user.UserId, user.CompanyId)
 	authInfo, permissionArr, e := services.GetUserRaiPermissionInfo(user.UserId, user.CompanyId)
@@ -128,7 +170,7 @@ func (this *MicroRoadShowController) List() {
 	}
 	}
 
 
 	resp := new(models.MicroRoadShowListResp)
 	resp := new(models.MicroRoadShowListResp)
-	page := paging.GetPaging(currentIndex, pageSize, total)
+	page := paging.GetPaging(currentIndex, pageSize, totalIk)
 	resp.List = list
 	resp.List = list
 	resp.Paging = page
 	resp.Paging = page
 
 

+ 1 - 1
controllers/report.go

@@ -12,7 +12,7 @@ import (
 	"time"
 	"time"
 )
 )
 
 
-//报告
+// 报告
 type ReportController struct {
 type ReportController struct {
 	BaseAuthController
 	BaseAuthController
 }
 }

+ 32 - 4
controllers/search.go

@@ -1,6 +1,7 @@
 package controllers
 package controllers
 
 
 import (
 import (
+	"fmt"
 	"github.com/rdlucklib/rdluck_tools/paging"
 	"github.com/rdlucklib/rdluck_tools/paging"
 	"hongze/hongze_clpt/models"
 	"hongze/hongze_clpt/models"
 	"hongze/hongze_clpt/services"
 	"hongze/hongze_clpt/services"
@@ -92,6 +93,8 @@ func (this *MobileSearchController) ListHomeArtAndChart() {
 	if orderColumn == "" {
 	if orderColumn == "" {
 		orderColumn = "Matching"
 		orderColumn = "Matching"
 	}
 	}
+
+	orderColumn = "Matching"
 	//indexName := utils.IndexName
 	//indexName := utils.IndexName
 	//pageSize = 20
 	//pageSize = 20
 	var chartTotal int
 	var chartTotal int
@@ -172,15 +175,40 @@ func (this *MobileSearchController) ListHomeArtAndChart() {
 		//	total = tmpTotal
 		//	total = tmpTotal
 		//	err = tmpErr
 		//	err = tmpErr
 		//}
 		//}
-		tmpResult, tmpTotal, tmpErr := services.EsArticleSearch(keyWord, startSize, pageSize, orderColumn)
-		result = tmpResult
-		total = tmpTotal
-		err = tmpErr
+		_, tmpTotal, err := services.EsArticleSearch(keyWord, startSize, pageSize, orderColumn, 0)
+		if err != nil {
+			br.Msg = "检索失败"
+			br.ErrMsg = "检索失败,Err:" + err.Error()
+			return
+		}
+		tmpResult, tmpTotalResult, err := services.EsArticleSearch(keyWord, startSize, pageSize, orderColumn, 1)
 		if err != nil {
 		if err != nil {
 			br.Msg = "检索失败"
 			br.Msg = "检索失败"
 			br.ErrMsg = "检索失败,Err:" + err.Error()
 			br.ErrMsg = "检索失败,Err:" + err.Error()
 			return
 			return
 		}
 		}
+		result = tmpResult
+		if int(tmpTotalResult) < currentIndex*pageSize {
+			fmt.Println(currentIndex * pageSize)
+			fmt.Println(startSize)
+			fmt.Println(tmpTotalResult)
+			startSizeIk := startSize - int(tmpTotalResult)
+			if startSizeIk < 0 {
+				startSizeIk = 0
+			}
+			var pageSizeIk int
+			pageSizeIk = pageSize - len(tmpResult)
+			tmpResultIk, _, err := services.EsArticleSearch(keyWord, startSizeIk, pageSizeIk, orderColumn, 2)
+			if err != nil {
+				br.Msg = "检索失败"
+				br.ErrMsg = "检索失败,Err:" + err.Error()
+				return
+			}
+			for _, v := range tmpResultIk {
+				result = append(result, v)
+			}
+		}
+		total = tmpTotal
 		if len(result) == 0 {
 		if len(result) == 0 {
 			result = make([]*models.SearchItem, 0)
 			result = make([]*models.SearchItem, 0)
 		}
 		}

+ 17 - 19
controllers/user.go

@@ -824,7 +824,6 @@ func (this *UserController) CollectList() {
 	br.Data = resp
 	br.Data = resp
 }
 }
 
 
-
 // @Title 获取我的留言
 // @Title 获取我的留言
 // @Description 获取我的留言列表
 // @Description 获取我的留言列表
 // @Param   PageSize    query   int true       "PageSize"
 // @Param   PageSize    query   int true       "PageSize"
@@ -874,19 +873,19 @@ func (this *UserController) CommnetList() {
 
 
 	for _, comment := range commentlist {
 	for _, comment := range commentlist {
 		item := models.CygxArticleCommentResp{
 		item := models.CygxArticleCommentResp{
-			Id:                comment.Id,
-			UserId:            comment.UserId,
-			ArticleId:         comment.ArticleId,
-			IndustryId:        comment.IndustryId,
-			ActivityId:        comment.ActivityId,
-			VideoId:           comment.VideoId,
-			CreateTime:        comment.CreateTime.Format(utils.FormatDateTime),
-			Mobile:            comment.Mobile,
-			Email:             comment.Email,
-			CompanyId:         comment.CompanyId,
-			CompanyName:       comment.CompanyName,
-			Content:           comment.Content,
-			Title:             comment.Title,
+			Id:          comment.Id,
+			UserId:      comment.UserId,
+			ArticleId:   comment.ArticleId,
+			IndustryId:  comment.IndustryId,
+			ActivityId:  comment.ActivityId,
+			VideoId:     comment.VideoId,
+			CreateTime:  comment.CreateTime.Format(utils.FormatDateTime),
+			Mobile:      comment.Mobile,
+			Email:       comment.Email,
+			CompanyId:   comment.CompanyId,
+			CompanyName: comment.CompanyName,
+			Content:     comment.Content,
+			Title:       comment.Title,
 		}
 		}
 		if comment.ArticleId > 0 {
 		if comment.ArticleId > 0 {
 			item.RedirectType = 1
 			item.RedirectType = 1
@@ -1104,7 +1103,6 @@ func (this *UserController) AskList() {
 	}
 	}
 	startSize = utils.StartIndex(currentIndex, pageSize)
 	startSize = utils.StartIndex(currentIndex, pageSize)
 
 
-
 	userId := this.User.UserId
 	userId := this.User.UserId
 	total, err := models.GetActivityAskCount(userId)
 	total, err := models.GetActivityAskCount(userId)
 	if err != nil {
 	if err != nil {
@@ -1231,7 +1229,7 @@ func (this *UserController) Mycollect() {
 			if count > 0 {
 			if count > 0 {
 				item.IsCollect = true
 				item.IsCollect = true
 			}
 			}
-			if v,ok := collectVoiceMap[item.Id]; ok{
+			if v, ok := collectVoiceMap[item.Id]; ok {
 				item.CollectTime = v
 				item.CollectTime = v
 			}
 			}
 		} else if item.Type == 2 {
 		} else if item.Type == 2 {
@@ -1245,7 +1243,7 @@ func (this *UserController) Mycollect() {
 			if count > 0 {
 			if count > 0 {
 				item.IsCollect = true
 				item.IsCollect = true
 			}
 			}
-			if v,ok := collectActivityVideoMap[item.Id]; ok{
+			if v, ok := collectActivityVideoMap[item.Id]; ok {
 				item.CollectTime = v
 				item.CollectTime = v
 			}
 			}
 		} else if item.Type == 3 {
 		} else if item.Type == 3 {
@@ -1259,7 +1257,7 @@ func (this *UserController) Mycollect() {
 			if count > 0 {
 			if count > 0 {
 				item.IsCollect = true
 				item.IsCollect = true
 			}
 			}
-			if v,ok := collectVideoMap[item.Id]; ok{
+			if v, ok := collectVideoMap[item.Id]; ok {
 				item.CollectTime = v
 				item.CollectTime = v
 			}
 			}
 		}
 		}
@@ -1343,4 +1341,4 @@ func (this *UserController) Mycollect() {
 	br.Success = true
 	br.Success = true
 	br.Msg = "获取成功"
 	br.Msg = "获取成功"
 	br.Data = resp
 	br.Data = resp
-}
+}

+ 32 - 16
models/activity.go

@@ -3,10 +3,11 @@ package models
 import (
 import (
 	"github.com/beego/beego/v2/client/orm"
 	"github.com/beego/beego/v2/client/orm"
 	"github.com/rdlucklib/rdluck_tools/paging"
 	"github.com/rdlucklib/rdluck_tools/paging"
+	"strings"
 	"time"
 	"time"
 )
 )
 
 
-//活动详情
+// 活动详情
 type CygxActivity struct {
 type CygxActivity struct {
 	ActivityId              int       `orm:"column(activity_id);pk";description:"活动ID 等于0新增活动,大于0修改活动"`
 	ActivityId              int       `orm:"column(activity_id);pk";description:"活动ID 等于0新增活动,大于0修改活动"`
 	ActivityTypeId          int       `description:"活动类型id"`
 	ActivityTypeId          int       `description:"活动类型id"`
@@ -59,7 +60,7 @@ type CygxActivity struct {
 	YidongActivityId        string    `description:"易董活动ID"`
 	YidongActivityId        string    `description:"易董活动ID"`
 }
 }
 
 
-//活动详情
+// 活动详情
 type ActivityDetail struct {
 type ActivityDetail struct {
 	ActivityId              int                        `orm:"column(activity_id);pk";description:"活动ID "`
 	ActivityId              int                        `orm:"column(activity_id);pk";description:"活动ID "`
 	ActivityTypeId          int                        `description:"活动类型id"`
 	ActivityTypeId          int                        `description:"活动类型id"`
@@ -142,7 +143,7 @@ type ActivityDetail struct {
 	Title                   string                     `description:"标题"`
 	Title                   string                     `description:"标题"`
 }
 }
 
 
-//活动详情
+// 活动详情
 type ActivityListResp struct {
 type ActivityListResp struct {
 	ActivityId              int                        `description:"活动ID "`
 	ActivityId              int                        `description:"活动ID "`
 	ActivityTypeId          int                        `description:"活动类型id"`
 	ActivityTypeId          int                        `description:"活动类型id"`
@@ -220,7 +221,7 @@ type CygxActivityResp struct {
 	Detail        *ActivityListResp
 	Detail        *ActivityListResp
 }
 }
 
 
-//列表
+// 列表
 func GetCygxActivityList(condition string, pars []interface{}, sortTime string, startSize, pageSize int) (items []*CygxActivity, err error) {
 func GetCygxActivityList(condition string, pars []interface{}, sortTime string, startSize, pageSize int) (items []*CygxActivity, err error) {
 	o := orm.NewOrm()
 	o := orm.NewOrm()
 	sql := `SELECT	activity_id, label,temporary_label,is_show_subject_name, MAX( art.activity_time ) AS timesort, MIn( art.activity_time ) AS mintimesort , yidong_activity_id , activity_type_id 
 	sql := `SELECT	activity_id, label,temporary_label,is_show_subject_name, MAX( art.activity_time ) AS timesort, MIn( art.activity_time ) AS mintimesort , yidong_activity_id , activity_type_id 
@@ -233,7 +234,7 @@ func GetCygxActivityList(condition string, pars []interface{}, sortTime string,
 	return
 	return
 }
 }
 
 
-//通过纪要ID获取活动详情
+// 通过纪要ID获取活动详情
 func GetAddActivityInfoById(ActivityId int) (item *ActivityDetail, err error) {
 func GetAddActivityInfoById(ActivityId int) (item *ActivityDetail, err error) {
 	o := orm.NewOrm()
 	o := orm.NewOrm()
 	sql := `SELECT * FROM cygx_activity  WHERE activity_id=? AND publish_status = 1 `
 	sql := `SELECT * FROM cygx_activity  WHERE activity_id=? AND publish_status = 1 `
@@ -241,7 +242,7 @@ func GetAddActivityInfoById(ActivityId int) (item *ActivityDetail, err error) {
 	return
 	return
 }
 }
 
 
-//获取数量
+// 获取数量
 func GetActivityCount(condition string, playBack int, pars []interface{}, filter int) (count int, err error) {
 func GetActivityCount(condition string, playBack int, pars []interface{}, filter int) (count int, err error) {
 	var sqlJiontable string
 	var sqlJiontable string
 	if playBack == 1 {
 	if playBack == 1 {
@@ -263,8 +264,7 @@ func GetActivityCount(condition string, playBack int, pars []interface{}, filter
 	return
 	return
 }
 }
 
 
-//列表
-func GetActivityListNew(condition string, pars []interface{}, uid, startSize, pageSize, playBack, filter int) (items []*ActivityDetail, err error) {
+func GetActivityListNew(condition string, pars []interface{}, uid, startSize, pageSize, playBack, filter int, typeName string) (items []*ActivityDetail, err error) {
 	var sqlJiontable string
 	var sqlJiontable string
 	if playBack == 1 {
 	if playBack == 1 {
 		//sqlJiontable = ` INNER JOIN cygx_activity_voice AS ac ON ac.activity_id = art.activity_id `
 		//sqlJiontable = ` INNER JOIN cygx_activity_voice AS ac ON ac.activity_id = art.activity_id `
@@ -276,7 +276,7 @@ func GetActivityListNew(condition string, pars []interface{}, uid, startSize, pa
 	}
 	}
 
 
 	o := orm.NewOrm()
 	o := orm.NewOrm()
-	sql := `SELECT art.* ,t.activity_type,t.img_url_text,c.image_url as  img_url,
+	sql := `SELECT art.* ,t.activity_type,t.img_url_text,c.image_url as  img_url,1 AS source_type,
 		( SELECT COUNT( 1 ) FROM cygx_activity_signup AS s WHERE s.activity_id = art.activity_id AND s.user_id = ?   AND s.is_cancel = 0  AND s.do_fail_type = 0) AS is_signup,
 		( SELECT COUNT( 1 ) FROM cygx_activity_signup AS s WHERE s.activity_id = art.activity_id AND s.user_id = ?   AND s.is_cancel = 0  AND s.do_fail_type = 0) AS is_signup,
 		( SELECT COUNT( DISTINCT user_id ) FROM cygx_activity_signup AS s WHERE s.activity_id = art.activity_id   AND s.is_cancel = 0  AND s.do_fail_type = 0) AS signup_num,
 		( SELECT COUNT( DISTINCT user_id ) FROM cygx_activity_signup AS s WHERE s.activity_id = art.activity_id   AND s.is_cancel = 0  AND s.do_fail_type = 0) AS signup_num,
 		( SELECT COUNT( 1 ) FROM cygx_activity_meeting_reminder AS m WHERE m.activity_id = art.activity_id AND m.user_id = ?  AND m.is_cancel = 0  ) AS is_cancel_meeting_reminder,
 		( SELECT COUNT( 1 ) FROM cygx_activity_meeting_reminder AS m WHERE m.activity_id = art.activity_id AND m.user_id = ?  AND m.is_cancel = 0  ) AS is_cancel_meeting_reminder,
@@ -288,11 +288,27 @@ func GetActivityListNew(condition string, pars []interface{}, uid, startSize, pa
 		sql += condition
 		sql += condition
 	}
 	}
 	sql += ` LIMIT ?,?`
 	sql += ` LIMIT ?,?`
+
+	if typeName != "" {
+		typeSlice := strings.Split(typeName, ",")
+		tempCondition := ""
+		for _, s := range typeSlice {
+			if s == "1" {
+				tempCondition += "'专家电话会',"
+			} else if s == "2" {
+				tempCondition += "'分析师电话会',"
+			} else if s == "1,2" {
+				tempCondition += "'专家电话会','分析师电话会',"
+			}
+		}
+		tempCondition = strings.TrimRight(tempCondition, ",")
+		sql = `SELECT * FROM(` + sql + `) AS t WHERE t.activity_type_name IN (` + tempCondition + `)`
+	}
 	_, err = o.Raw(sql, uid, uid, uid, pars, startSize, pageSize).QueryRows(&items)
 	_, err = o.Raw(sql, uid, uid, uid, pars, startSize, pageSize).QueryRows(&items)
 	return
 	return
 }
 }
 
 
-//列表
+// 列表
 func GetActivityListHomeNew(condition string, startSize, pageSize int) (items []*ActivityDetail, err error) {
 func GetActivityListHomeNew(condition string, startSize, pageSize int) (items []*ActivityDetail, err error) {
 	o := orm.NewOrm()
 	o := orm.NewOrm()
 	sql := `SELECT activity_id
 	sql := `SELECT activity_id
@@ -331,7 +347,7 @@ type GetCygxActivityListSearchResp struct {
 	ChartPermissionId      int    `description:"权限id"`
 	ChartPermissionId      int    `description:"权限id"`
 }
 }
 
 
-//通过纪要ID获取活动详情
+// 通过纪要ID获取活动详情
 func GetAddActivityInfoByIdShow(uid, ActivityId int) (item *ActivityDetail, err error) {
 func GetAddActivityInfoByIdShow(uid, ActivityId int) (item *ActivityDetail, err error) {
 	o := orm.NewOrm()
 	o := orm.NewOrm()
 	sql := `SELECT *,( SELECT COUNT( 1 ) FROM cygx_activity_signup AS s WHERE s.activity_id = a.activity_id AND s.user_id = ?   AND s.is_cancel = 0  AND s.do_fail_type = 0) AS is_signup,
 	sql := `SELECT *,( SELECT COUNT( 1 ) FROM cygx_activity_signup AS s WHERE s.activity_id = a.activity_id AND s.user_id = ?   AND s.is_cancel = 0  AND s.do_fail_type = 0) AS is_signup,
@@ -343,7 +359,7 @@ func GetAddActivityInfoByIdShow(uid, ActivityId int) (item *ActivityDetail, err
 	return
 	return
 }
 }
 
 
-//GetActivitySpecialSearcheList 活动与专项调研的搜索
+// GetActivitySpecialSearcheList 活动与专项调研的搜索
 func GetActivitySpecialSearcheList(condition string, pars []interface{}, conditionSpecil string, parsSpecil []interface{}, startSize, pageSize int) (items []*ActivityDetail, total int, err error) {
 func GetActivitySpecialSearcheList(condition string, pars []interface{}, conditionSpecil string, parsSpecil []interface{}, startSize, pageSize int) (items []*ActivityDetail, total int, err error) {
 	o := orm.NewOrm()
 	o := orm.NewOrm()
 	sql := `SELECT
 	sql := `SELECT
@@ -412,7 +428,7 @@ func GetActivitySpecialSearcheList(condition string, pars []interface{}, conditi
 	return
 	return
 }
 }
 
 
-//获取我的日程数量
+// 获取我的日程数量
 func GetScheduleCount(condition string, uid int) (count int, err error) {
 func GetScheduleCount(condition string, uid int) (count int, err error) {
 	o := orm.NewOrm()
 	o := orm.NewOrm()
 	sqlCount := `SELECT COUNT( 1 ) AS count 
 	sqlCount := `SELECT COUNT( 1 ) AS count 
@@ -427,7 +443,7 @@ func GetScheduleCount(condition string, uid int) (count int, err error) {
 	return
 	return
 }
 }
 
 
-//获取我的日程数量
+// 获取我的日程数量
 func GetSpecialScheduleCount(uid int) (count int, err error) {
 func GetSpecialScheduleCount(uid int) (count int, err error) {
 	o := orm.NewOrm()
 	o := orm.NewOrm()
 	sqlCount := `
 	sqlCount := `
@@ -440,7 +456,7 @@ SELECT COUNT( 1 ) AS count FROM
 	return
 	return
 }
 }
 
 
-//我的日程列表
+// 我的日程列表
 func GetScheduleList(condition string, pars []interface{}, uid, startSize, pageSize int) (items []*ActivityDetail, err error) {
 func GetScheduleList(condition string, pars []interface{}, uid, startSize, pageSize int) (items []*ActivityDetail, err error) {
 	o := orm.NewOrm()
 	o := orm.NewOrm()
 	sql := `SELECT art.*,t.activity_type,t.img_url_text,c.image_url as  img_url,
 	sql := `SELECT art.*,t.activity_type,t.img_url_text,c.image_url as  img_url,
@@ -462,7 +478,7 @@ func GetScheduleList(condition string, pars []interface{}, uid, startSize, pageS
 	return
 	return
 }
 }
 
 
-//我的日程列表 活动以及专项调研一起
+// 我的日程列表 活动以及专项调研一起
 func GetScheduleAndSpecilList(condition string, pars []interface{}, conditionSpecil string, parsSpecil []interface{}, startSize, pageSize int) (items []*ActivityDetail, err error) {
 func GetScheduleAndSpecilList(condition string, pars []interface{}, conditionSpecil string, parsSpecil []interface{}, startSize, pageSize int) (items []*ActivityDetail, err error) {
 	o := orm.NewOrm()
 	o := orm.NewOrm()
 	sql := `SELECT
 	sql := `SELECT

+ 159 - 2
models/micro_roadshow.go

@@ -174,7 +174,7 @@ func GetMicroRoadshowVideoByIndustryId(industryId int) (item *MicroRoadshowVideo
 	return
 	return
 }
 }
 
 
-//GetMicroRoadshowVideoByIndustryIdCount  根据行业ID查询产业视频是否存在
+// GetMicroRoadshowVideoByIndustryIdCount  根据行业ID查询产业视频是否存在
 func GetMicroRoadshowVideoByIndustryIdCount(industryId int) (count int, err error) {
 func GetMicroRoadshowVideoByIndustryIdCount(industryId int) (count int, err error) {
 	o := orm.NewOrm()
 	o := orm.NewOrm()
 	sql := `SELECT COUNT(1) count
 	sql := `SELECT COUNT(1) count
@@ -183,7 +183,7 @@ func GetMicroRoadshowVideoByIndustryIdCount(industryId int) (count int, err erro
 	return
 	return
 }
 }
 
 
-//GetMicroRoadshowVideoByVideoIdCount  根据视频ID查询产业视频是否存在
+// GetMicroRoadshowVideoByVideoIdCount  根据视频ID查询产业视频是否存在
 func GetMicroRoadshowVideoByVideoIdCount(industryId int) (count int, err error) {
 func GetMicroRoadshowVideoByVideoIdCount(industryId int) (count int, err error) {
 	o := orm.NewOrm()
 	o := orm.NewOrm()
 	sql := `SELECT COUNT(1) count
 	sql := `SELECT COUNT(1) count
@@ -305,3 +305,160 @@ func (m MicroList) Less(i, j int) bool {
 func (m MicroList) Swap(i, j int) {
 func (m MicroList) Swap(i, j int) {
 	m[i], m[j] = m[j], m[i]
 	m[i], m[j] = m[j], m[i]
 }
 }
+
+// CountMicroRoadShowVideoPageList 获取微路演视频数量
+func CountMicroRoadShowVideoPageList(condition string, pars []interface{}, conditionAct string, parsAct []interface{}, conditionAudio string, parsAudio []interface{}) (total int, err error) {
+	o := orm.NewOrm()
+	var sql string
+	sql += `SELECT
+			video_id AS id,
+			video_name AS title,
+			video_url AS resource_url,
+			3 AS type,
+			publish_date AS publish_time,
+			chart_permission_id,
+			chart_permission_name,
+			video_duration AS play_seconds,
+			img_url AS background_img,            
+			industry_name,
+			share_img_url AS share_img,
+			"" as  activity_id
+		FROM
+			cygx_micro_roadshow_video 
+		WHERE
+			publish_status = 1 `
+	if condition != `` {
+		sql += condition
+	}
+	sql += `  UNION ALL `
+	sql += `
+		SELECT
+			video_id AS id,
+			video_name AS title,
+			video_url AS resource_url,
+			2 AS type,
+		art.activity_time as publish_time,
+			art.chart_permission_id,
+			art.chart_permission_name,
+			"" AS play_seconds,
+			"" AS background_img,
+			"" AS industry_name,
+			"" AS share_img,
+			v.activity_id
+		FROM
+			cygx_activity_video as v
+			INNER JOIN cygx_activity as art on art.activity_id = v.activity_id WHERE 1= 1  `
+	if conditionAct != `` {
+		sql += conditionAct
+	}
+	sql += `  UNION ALL `
+	sql += `
+			SELECT
+			a.activity_voice_id AS id,
+			a.voice_name AS title,
+			a.voice_url AS resource_url,
+			1 AS type,
+			b.activity_time AS publish_time,
+			b.chart_permission_id,
+			b.chart_permission_name,
+			a.voice_play_seconds AS play_seconds,
+			a.img_url AS background_img,
+			"" AS industry_name,
+			"" AS share_img,
+			a.activity_id 
+		FROM
+			cygx_activity_voice AS a
+			JOIN cygx_activity AS b ON a.activity_id = b.activity_id  WHERE 1= 1  `
+	if conditionAudio != `` {
+		sql += conditionAudio
+	}
+
+	sql += ` ORDER BY publish_time DESC`
+	totalSql := `SELECT COUNT(1) total FROM (` + sql + `) z `
+	err = o.Raw(totalSql, pars, parsAct, parsAudio).QueryRow(&total)
+	return
+}
+
+// GetMicroRoadShowVideoPageList 获取微路演视频列表-分页
+func GetMicroRoadShowVideoPageListIkWord(startSize, pageSize int, condition string, pars []interface{}, conditionAct string, parsAct []interface{}, conditionAudio string, parsAudio []interface{}, audioId, videoId, activityVideoId, filter int) (list []*MicroRoadShowPageList, err error) {
+	o := orm.NewOrm()
+	var sql string
+	//if audioId+activityVideoId == 0 && filter != 2 {
+	sql += `SELECT
+			video_id AS id,
+			video_name AS title,
+			video_url AS resource_url,
+			3 AS type,
+			publish_date AS publish_time,
+			chart_permission_id,
+			chart_permission_name,
+			video_duration AS play_seconds,
+			img_url AS background_img,            
+			industry_name,
+			share_img_url AS share_img,
+			"" as  activity_id
+		FROM
+			cygx_micro_roadshow_video 
+		WHERE
+			publish_status = 1 `
+	if condition != `` {
+		sql += condition
+	}
+	//}
+	//if audioId+videoId+activityVideoId == 0 && filter != 2 {
+	//	sql += `  UNION ALL `
+	//}
+	sql += `  UNION ALL `
+	//if audioId+videoId == 0 && filter != 2 {
+	sql += `
+		SELECT
+			video_id AS id,
+			video_name AS title,
+			video_url AS resource_url,
+			2 AS type,
+			art.activity_time as publish_time,
+			art.chart_permission_id,
+			art.chart_permission_name,
+			"" AS play_seconds,
+			"" AS background_img,
+			"" AS industry_name,
+			"" AS share_img,
+			v.activity_id
+		FROM
+			cygx_activity_video as v
+			INNER JOIN cygx_activity as art on art.activity_id = v.activity_id WHERE 1= 1  `
+	if conditionAct != `` {
+		sql += conditionAct
+	}
+	//}
+	//if audioId+videoId+activityVideoId == 0 && filter == 0 {
+	//	sql += `  UNION ALL `
+	//}
+	sql += `  UNION ALL `
+	//if videoId+activityVideoId == 0 && filter != 1 {
+	sql += `
+			SELECT
+			a.activity_voice_id AS id,
+			a.voice_name AS title,
+			a.voice_url AS resource_url,
+			1 AS type,
+			b.activity_time AS publish_time,
+			b.chart_permission_id,
+			b.chart_permission_name,
+			a.voice_play_seconds AS play_seconds,
+			a.img_url AS background_img,
+			"" AS industry_name,
+			"" AS share_img,
+			a.activity_id 
+		FROM
+			cygx_activity_voice AS a
+			JOIN cygx_activity AS b ON a.activity_id = b.activity_id  WHERE 1= 1  `
+	if conditionAudio != `` {
+		sql += conditionAudio
+	}
+	//}
+	sql += ` ORDER BY publish_time DESC`
+	sql += ` LIMIT ?,?`
+	_, err = o.Raw(sql, pars, parsAct, parsAudio, startSize, pageSize).QueryRows(&list)
+	return
+}

+ 8 - 7
models/session.go

@@ -6,7 +6,8 @@ import (
 )
 )
 
 
 func GetSessionByToken(token string) (item *CygxClptSession, err error) {
 func GetSessionByToken(token string) (item *CygxClptSession, err error) {
-	sql := `SELECT * FROM cygx_clpt_session WHERE access_token=? AND expire_time> NOW() ORDER BY session_id DESC LIMIT 1 `
+	//sql := `SELECT * FROM cygx_clpt_session WHERE access_token=? AND expire_time> NOW() ORDER BY session_id DESC LIMIT 1 `
+	sql := `SELECT * FROM cygx_clpt_session WHERE access_token=?  ORDER BY session_id DESC LIMIT 1 `
 	o := orm.NewOrm()
 	o := orm.NewOrm()
 	err = o.Raw(sql, token).QueryRow(&item)
 	err = o.Raw(sql, token).QueryRow(&item)
 	return
 	return
@@ -24,7 +25,7 @@ type CygxClptSession struct {
 	UnionId         string `description:"用户unionid,最大长度:64"`
 	UnionId         string `description:"用户unionid,最大长度:64"`
 }
 }
 
 
-//添加用户session信息
+// 添加用户session信息
 func AddCygxClptSession(item *CygxClptSession) (err error) {
 func AddCygxClptSession(item *CygxClptSession) (err error) {
 	o := orm.NewOrm()
 	o := orm.NewOrm()
 	_, err = o.Insert(item)
 	_, err = o.Insert(item)
@@ -38,7 +39,7 @@ func GetXzsSessionCountByToken(token string) (count int, err error) {
 	return
 	return
 }
 }
 
 
-//获取用户token详情
+// 获取用户token详情
 func GetUnionidByToken(token string) (item *CygxClptSession, err error) {
 func GetUnionidByToken(token string) (item *CygxClptSession, err error) {
 	sql := `SELECT * FROM cygx_xzs_session WHERE access_token=?  LIMIT 1 `
 	sql := `SELECT * FROM cygx_xzs_session WHERE access_token=?  LIMIT 1 `
 	o := orm.NewOrm()
 	o := orm.NewOrm()
@@ -46,7 +47,7 @@ func GetUnionidByToken(token string) (item *CygxClptSession, err error) {
 	return
 	return
 }
 }
 
 
-//根据用户openid获取token
+// 根据用户openid获取token
 func GetTokenByOpenId(mobile string) (item *CygxClptSession, err error) {
 func GetTokenByOpenId(mobile string) (item *CygxClptSession, err error) {
 	sql := `SELECT * FROM cygx_clpt_session WHERE mobile=? AND expire_time> NOW() ORDER BY session_id DESC LIMIT 1 `
 	sql := `SELECT * FROM cygx_clpt_session WHERE mobile=? AND expire_time> NOW() ORDER BY session_id DESC LIMIT 1 `
 	o := orm.NewOrm()
 	o := orm.NewOrm()
@@ -54,7 +55,7 @@ func GetTokenByOpenId(mobile string) (item *CygxClptSession, err error) {
 	return
 	return
 }
 }
 
 
-//用户绑定手机号时同时绑定外呼手机号
+// 用户绑定手机号时同时绑定外呼手机号
 func BindSessionMobile(mobile, token string) (err error) {
 func BindSessionMobile(mobile, token string) (err error) {
 	o := orm.NewOrm()
 	o := orm.NewOrm()
 	sql := `UPDATE cygx_clpt_session SET mobile=?  WHERE access_token=? `
 	sql := `UPDATE cygx_clpt_session SET mobile=?  WHERE access_token=? `
@@ -62,9 +63,9 @@ func BindSessionMobile(mobile, token string) (err error) {
 	return
 	return
 }
 }
 
 
-//根据用户id和平台id获取用户关系
+// 根据用户id和平台id获取用户关系
 func GetUserSessionByUserId(userId int) (item *CygxClptSession, err error) {
 func GetUserSessionByUserId(userId int) (item *CygxClptSession, err error) {
 	sql := `SELECT * FROM cygx_clpt_session WHERE user_id=? `
 	sql := `SELECT * FROM cygx_clpt_session WHERE user_id=? `
 	err = orm.NewOrm().Raw(sql, userId).QueryRow(&item)
 	err = orm.NewOrm().Raw(sql, userId).QueryRow(&item)
 	return
 	return
-}
+}

+ 31 - 14
services/activity.go

@@ -19,7 +19,9 @@ import (
 // @Param   Label   query   string  false       "搜索主题 多个用 , 隔开"
 // @Param   Label   query   string  false       "搜索主题 多个用 , 隔开"
 // @Param   PlayBack   query   int  false       "是否仅展示回放 1:是、0:否 默认0"
 // @Param   PlayBack   query   int  false       "是否仅展示回放 1:是、0:否 默认0"
 // @Param   KeyWord   query   string  false       "搜索关键词"
 // @Param   KeyWord   query   string  false       "搜索关键词"
-func GetActivityonditionList(user *models.WxUserItem, activityTypeId, chartPermissionIds, whichDay, activeState, label string, isPower, source int, keyWord string, playBack int) (conditionActivity string, err error) {
+// @Param   ikType   query   int  false       "联想词类型 , 1不做联想,2,做除初始词的联想,3所有联想"
+func GetActivityonditionList(user *models.WxUserItem, activityTypeId, chartPermissionIds, whichDay, activeState, label string, isPower, source int, keyWord string, playBack, ikType int) (conditionActivity string, err error) {
+	keyWordNoIk := keyWord
 	adminIds, err := models.GetSelleridWhichGroup(user.CompanyId, 2)
 	adminIds, err := models.GetSelleridWhichGroup(user.CompanyId, 2)
 	if err != nil {
 	if err != nil {
 		return
 		return
@@ -62,7 +64,7 @@ func GetActivityonditionList(user *models.WxUserItem, activityTypeId, chartPermi
 	var conditionAdmin string
 	var conditionAdmin string
 	var conditionHz string // 弘则权限处理
 	var conditionHz string // 弘则权限处理
 	var sqlExport string   // 专家权限处理
 	var sqlExport string   // 专家权限处理
-	//permissionSqlStr = `  AND art.chart_permission_name  IN (` + permissionNameStr + `)`
+	permissionSqlStr = `  AND art.chart_permission_name  IN (` + permissionNameStr + `)`
 	sqlExport = ` AND (art.customer_type_ids LIKE '%` + strconv.Itoa(userType) + `%' `
 	sqlExport = ` AND (art.customer_type_ids LIKE '%` + strconv.Itoa(userType) + `%' `
 	if userType == 2 {
 	if userType == 2 {
 		sqlExport += ` OR  art.customer_type_ids LIKE '%3%' `
 		sqlExport += ` OR  art.customer_type_ids LIKE '%3%' `
@@ -76,14 +78,13 @@ func GetActivityonditionList(user *models.WxUserItem, activityTypeId, chartPermi
 		if activityTypeId == strconv.Itoa(utils.ANALYST_TELL_ACTIVITY_TYPE_ID) {
 		if activityTypeId == strconv.Itoa(utils.ANALYST_TELL_ACTIVITY_TYPE_ID) {
 			condition = ` AND art.publish_status = 1  AND art.label != ''  AND art.activity_type_id IN (` + activityTypeId + "," + strconv.Itoa(utils.C_CLASS_ACTIVITY_TYPE_ID) + `)`
 			condition = ` AND art.publish_status = 1  AND art.label != ''  AND art.activity_type_id IN (` + activityTypeId + "," + strconv.Itoa(utils.C_CLASS_ACTIVITY_TYPE_ID) + `)`
 		} else {
 		} else {
-			condition = ` AND art.publish_status = 1  AND art.label != ''  AND art.activity_type_id = ` + activityTypeId
+			condition = ` AND art.publish_status = 1  AND art.label != ''  AND art.activity_type_id IN (` + activityTypeId + `)`
 		}
 		}
 	}
 	}
 
 
 	//主题
 	//主题
 	if label != "" {
 	if label != "" {
 		condition = ` AND art.label  LIKE '%` + label + `%' `
 		condition = ` AND art.label  LIKE '%` + label + `%' `
-
 	}
 	}
 
 
 	if isPower == 1 {
 	if isPower == 1 {
@@ -92,7 +93,6 @@ func GetActivityonditionList(user *models.WxUserItem, activityTypeId, chartPermi
 
 
 	//行业名称
 	//行业名称
 	if len(chartPermissionIds) > 0 {
 	if len(chartPermissionIds) > 0 {
-
 		condition += ` AND art.chart_permission_id  IN (` + chartPermissionIds + `)`
 		condition += ` AND art.chart_permission_id  IN (` + chartPermissionIds + `)`
 	}
 	}
 	//如果是PC的,则不看易董的
 	//如果是PC的,则不看易董的
@@ -110,9 +110,6 @@ func GetActivityonditionList(user *models.WxUserItem, activityTypeId, chartPermi
 		} else if whichDay == "2" {
 		} else if whichDay == "2" {
 			startDate = time.Now().AddDate(0, 0, +1).Format(utils.FormatDate)
 			startDate = time.Now().AddDate(0, 0, +1).Format(utils.FormatDate)
 			endDate = startDate
 			endDate = startDate
-		} else if whichDay == "1,2" || whichDay == "2,1" {
-			startDate = time.Now().Format(utils.FormatDate)
-			endDate = time.Now().AddDate(0, 0, +1).Format(utils.FormatDate)
 		} else if whichDay == "3" {
 		} else if whichDay == "3" {
 			startDate = utils.GetNowWeekMonday().Format(utils.FormatDate)
 			startDate = utils.GetNowWeekMonday().Format(utils.FormatDate)
 			endDate = utils.GetNowWeekSunday().Format(utils.FormatDate)
 			endDate = utils.GetNowWeekSunday().Format(utils.FormatDate)
@@ -125,24 +122,43 @@ func GetActivityonditionList(user *models.WxUserItem, activityTypeId, chartPermi
 		} else if whichDay == "6" {
 		} else if whichDay == "6" {
 			startDate = utils.GetLastMonthFirstDay().Format(utils.FormatDate)
 			startDate = utils.GetLastMonthFirstDay().Format(utils.FormatDate)
 			endDate = utils.GetLastMonthLastDay().Format(utils.FormatDate)
 			endDate = utils.GetLastMonthLastDay().Format(utils.FormatDate)
-		} else if whichDay == "3,4" || whichDay == "4,3" {
+		} else if whichDay == "1,2" {
+			startDate = time.Now().Format(utils.FormatDate)
+			endDate = time.Now().AddDate(0, 0, +1).Format(utils.FormatDate)
+		} else if whichDay == "3,4" {
 			startDate = utils.GetLastWeekMonday().Format(utils.FormatDate)
 			startDate = utils.GetLastWeekMonday().Format(utils.FormatDate)
 			endDate = utils.GetNowWeekSunday().Format(utils.FormatDate)
 			endDate = utils.GetNowWeekSunday().Format(utils.FormatDate)
-		} else if whichDay == "5,6" || whichDay == "6,5" {
+		} else if whichDay == "5,6" {
 			startDate = utils.GetLastMonthFirstDay().Format(utils.FormatDate)
 			startDate = utils.GetLastMonthFirstDay().Format(utils.FormatDate)
 			endDate = utils.GetNowMonthLastDay().Format(utils.FormatDate)
 			endDate = utils.GetNowMonthLastDay().Format(utils.FormatDate)
 		} else {
 		} else {
-			startDate = utils.GetNowWeekMonday().Format(utils.FormatDate)
-			endDate = utils.GetNowWeekSunday().Format(utils.FormatDate)
+			startDate = time.Now().Format(utils.FormatDate)
+			endDate = time.Now().AddDate(0, 0, +1).Format(utils.FormatDate)
 		}
 		}
 		condition += ` AND art.activity_time >= ` + "'" + startDate + " 00:00:00'"
 		condition += ` AND art.activity_time >= ` + "'" + startDate + " 00:00:00'"
 		condition += ` AND art.activity_time <= ` + "'" + endDate + " 23:59:59'"
 		condition += ` AND art.activity_time <= ` + "'" + endDate + " 23:59:59'"
-
 	}
 	}
 
 
 	//有搜索条件传过来时,不判进行状态条件
 	//有搜索条件传过来时,不判进行状态条件
 	if keyWord != "" {
 	if keyWord != "" {
-		condition += ` AND (art.label  LIKE '%` + keyWord + `%' OR art.activity_name  LIKE '%` + keyWord + `%' ) `
+		if ikType == 2 || ikType == 3 {
+			keyWordArr, e := GetIndustryMapNameSliceV3(keyWord)
+			if e != nil {
+				err = errors.New("获取分词失败,GetIndustryMapNameSliceV3, Err: " + keyWord + e.Error())
+				return
+			}
+			keyWordArr = RemoveDuplicatesAndEmpty(keyWordArr)
+			//var keywords string
+			if len(keyWordArr) > 1 {
+				if ikType == 2 {
+					keyWord = KeyWordArrSqlRegexp(keyWordArr)
+					condition += `	AND (art.label NOT LIKE  '%` + keyWordNoIk + `%' AND   art.activity_name NOT LIKE '%` + keyWordNoIk + `%' ) `
+				} else if ikType == 3 {
+					keyWord = KeyWordArrSqlRegexpAll(keyWordArr)
+				}
+			}
+		}
+		condition += ` AND (art.label   REGEXP '` + keyWord + `' OR art.activity_name  REGEXP '` + keyWord + `' ) `
 	} else {
 	} else {
 		if activeState != "" {
 		if activeState != "" {
 			// 默认查看未开始跟进行中
 			// 默认查看未开始跟进行中
@@ -187,6 +203,7 @@ func GetActivityonditionList(user *models.WxUserItem, activityTypeId, chartPermi
 	}
 	}
 
 
 	//查询全部可见的数据(是否全部客户可见)
 	//查询全部可见的数据(是否全部客户可见)
+	//condition += ` AND art.visible_range != 1  AND art.publish_status = 1 `
 	condition += `   AND art.publish_status = 1 `
 	condition += `   AND art.publish_status = 1 `
 	conditionHz = condition
 	conditionHz = condition
 
 

+ 61 - 19
services/activity_special.go

@@ -84,7 +84,7 @@ func ActivityLabelSpecialSql(chartPermissionIds, whichDay, activeState string) (
 	return
 	return
 }
 }
 
 
-//处理专项调研的展示
+// 处理专项调研的展示
 func GetActivityLabelSpecialList(user *models.WxUserItem, conditionActivitySpecial string) (item *models.ActivityTypeHome, err error) {
 func GetActivityLabelSpecialList(user *models.WxUserItem, conditionActivitySpecial string) (item *models.ActivityTypeHome, err error) {
 	itemList := new(models.ActivityTypeHome)
 	itemList := new(models.ActivityTypeHome)
 	if user.CompanyId <= 1 {
 	if user.CompanyId <= 1 {
@@ -169,7 +169,7 @@ func GetActivityLabelSpecialList(user *models.WxUserItem, conditionActivitySpeci
 	return
 	return
 }
 }
 
 
-//HandleActivityLabelSpecialPermission 处理专项产业调研的查询权限sql 永续
+// HandleActivityLabelSpecialPermission 处理专项产业调研的查询权限sql 永续
 func HandleActivityLabelSpecialPermission(user *models.WxUserItem) (condition string, err error) {
 func HandleActivityLabelSpecialPermission(user *models.WxUserItem) (condition string, err error) {
 	permissionStr, e := GetCompanyPermission(user.CompanyId)
 	permissionStr, e := GetCompanyPermission(user.CompanyId)
 	if e != nil {
 	if e != nil {
@@ -201,7 +201,7 @@ func HandleActivityLabelSpecialPermission(user *models.WxUserItem) (condition st
 	return
 	return
 }
 }
 
 
-//HandleActivityLabelSpecialPermisseion 处理专项产业调研的查询权限sql
+// HandleActivityLabelSpecialPermisseion 处理专项产业调研的查询权限sql
 func HandleActivityLabelSpecialTripPermission(user *models.WxUserItem) (condition string, err error) {
 func HandleActivityLabelSpecialTripPermission(user *models.WxUserItem) (condition string, err error) {
 	permissionStr, e := GetCompanyPermission(user.CompanyId)
 	permissionStr, e := GetCompanyPermission(user.CompanyId)
 	if e != nil {
 	if e != nil {
@@ -233,7 +233,7 @@ func HandleActivityLabelSpecialTripPermission(user *models.WxUserItem) (conditio
 	return
 	return
 }
 }
 
 
-//获取预报名列表
+// 获取预报名列表
 func GetActivitySpecialPrepareList(user *models.WxUserItem, startSize, pageSize int, keywords, conditionActivity string) (list []*models.CygxActivitySpecialDetail, totalPrepare int, err error) {
 func GetActivitySpecialPrepareList(user *models.WxUserItem, startSize, pageSize int, keywords, conditionActivity string) (list []*models.CygxActivitySpecialDetail, totalPrepare int, err error) {
 	companyDetail, e := models.GetCompanyDetailByIdGroupTrip(user.CompanyId)
 	companyDetail, e := models.GetCompanyDetailByIdGroupTrip(user.CompanyId)
 	if e != nil && e.Error() != utils.ErrNoRow() {
 	if e != nil && e.Error() != utils.ErrNoRow() {
@@ -378,7 +378,7 @@ func GetActivityLabelSpecialConfirmList(user *models.WxUserItem, startSize, page
 	return
 	return
 }
 }
 
 
-//获取用户已经报名的活动
+// 获取用户已经报名的活动
 func GetSpecialTripUserMap(activityIds []int, userId int) (mapUserId map[int]int, err error) {
 func GetSpecialTripUserMap(activityIds []int, userId int) (mapUserId map[int]int, err error) {
 	var condition string
 	var condition string
 	var pars []interface{}
 	var pars []interface{}
@@ -402,7 +402,7 @@ func GetSpecialTripUserMap(activityIds []int, userId int) (mapUserId map[int]int
 	return
 	return
 }
 }
 
 
-//获取用户已经报名的活动数量
+// 获取用户已经报名的活动数量
 func GetSpecialTripUserSchedule(userId int) (total int, err error) {
 func GetSpecialTripUserSchedule(userId int) (total int, err error) {
 	var condition string
 	var condition string
 	var pars []interface{}
 	var pars []interface{}
@@ -416,7 +416,7 @@ func GetSpecialTripUserSchedule(userId int) (total int, err error) {
 	return
 	return
 }
 }
 
 
-//GetActivitySpecialList 获取专项调研列表
+// GetActivitySpecialList 获取专项调研列表
 func GetActivitySpecialList(user *models.WxUserItem, currentIndex, pageSize int, keywords, conditionActivity, activeState string) (list []*models.CygxActivitySpecialDetail, total int, err error) {
 func GetActivitySpecialList(user *models.WxUserItem, currentIndex, pageSize int, keywords, conditionActivity, activeState string) (list []*models.CygxActivitySpecialDetail, total int, err error) {
 
 
 	state := 4
 	state := 4
@@ -510,7 +510,7 @@ func GetActivitySpecialList(user *models.WxUserItem, currentIndex, pageSize int,
 	return
 	return
 }
 }
 
 
-//HandleActivitySpecialShow 处理活动的状态
+// HandleActivitySpecialShow 处理活动的状态
 func HandleActivitySpecialShow(activityDetail *models.CygxActivitySpecialDetail, user *models.WxUserItem) (item *models.CygxActivitySpecialDetail, err error) {
 func HandleActivitySpecialShow(activityDetail *models.CygxActivitySpecialDetail, user *models.WxUserItem) (item *models.CygxActivitySpecialDetail, err error) {
 	var activityIds []int
 	var activityIds []int
 	resultTimeStart := utils.StrTimeToTime(activityDetail.ActivityTime)  //时间字符串格式转时间格式
 	resultTimeStart := utils.StrTimeToTime(activityDetail.ActivityTime)  //时间字符串格式转时间格式
@@ -547,35 +547,77 @@ func HandleActivitySpecialShow(activityDetail *models.CygxActivitySpecialDetail,
 	return
 	return
 }
 }
 
 
-//活动与专项调研搜索 GetActivitySpecialSearcheList
-func GetActivitySpecialSearcheList(user *models.WxUserItem, condition string, startSize, pageSize int, keywords string, playBack int) (items []*models.ActivityDetail, total int, err error) {
+// 活动与专项调研搜索 GetActivitySpecialSearcheList
+// 活动与专项调研搜索 GetActivitySpecialSearcheList
+func GetActivitySpecialSearcheList(user *models.WxUserItem, condition string, startSize, pageSize, playBack int, keywords string) (items []*models.ActivityDetail, total int, err error) {
 	var conditionSpecil string
 	var conditionSpecil string
 	var pars, parsSpecil []interface{}
 	var pars, parsSpecil []interface{}
+	keyword := keywords
 	if keywords != "" {
 	if keywords != "" {
 		keywords = "%" + keywords + "%"
 		keywords = "%" + keywords + "%"
-		conditionSpecil += ` AND art.days > 0 AND art.publish_status = 1 AND (art.research_theme LIKE ? OR art.label LIKE ? OR art.industrial_name LIKE ? OR art.industrial_subject_name LIKE ? ) `
+		conditionSpecil += ` AND art.days > 0 AND (art.research_theme LIKE ? OR art.label LIKE ? OR art.industrial_name LIKE ? OR art.industrial_subject_name LIKE ? ) `
 		parsSpecil = append(parsSpecil, keywords, keywords, keywords, keywords)
 		parsSpecil = append(parsSpecil, keywords, keywords, keywords, keywords)
 	}
 	}
-
 	if playBack == 1 {
 	if playBack == 1 {
-		conditionSpecil += ` AND art.activity_id = 0 `
+		conditionSpecil += `  AND art.activity_id = 0  `
 	}
 	}
 	list, totalSearche, e := models.GetActivitySpecialSearcheList(condition, pars, conditionSpecil, parsSpecil, startSize, pageSize)
 	list, totalSearche, e := models.GetActivitySpecialSearcheList(condition, pars, conditionSpecil, parsSpecil, startSize, pageSize)
 	if e != nil {
 	if e != nil {
 		err = errors.New("GetActivitySpecialSearcheList, Err: " + e.Error())
 		err = errors.New("GetActivitySpecialSearcheList, Err: " + e.Error())
 		return
 		return
 	}
 	}
+	//return
+
+	// 查询IK分词后那一部分的数据
+	conditionActivityIk, e := GetActivityonditionList(user, "", "", "", "", "", 0, 1, keyword, playBack, 2)
+	if e != nil && e.Error() != utils.ErrNoRow() {
+		err = errors.New("GetActivityonditionList, Err: " + e.Error())
+		return
+	}
+	conditionActivityIk += " AND art.is_limit_people = 1 AND art.publish_status = 1  "
+
+	totalIk, e := models.GetActivityCount(conditionActivityIk, 0, pars, 0)
+	if e != nil {
+		err = errors.New("GetActivityonditionList, Err: " + e.Error())
+		return
+	}
+	//return
+	fmt.Println("totalIk", totalIk)
+	total = totalSearche + totalIk
+	keyWordArr, e := GetIndustryMapNameSliceV3(keywords)
+	if e != nil {
+		err = errors.New("GetActivityonditionList, Err: " + e.Error())
+		return
+	}
+	keyWordArr = RemoveDuplicatesAndEmpty(keyWordArr)
+	startSizeIk := startSize - totalSearche
+	if startSizeIk < 0 {
+		startSizeIk = 0
+	}
+	var pageSizeIk int
+	pageSizeIk = pageSize - len(list)
+	if pageSizeIk > 0 {
+		//搜索关键词联想
+		conditionActivityIk += ` ORDER BY art.activity_time DESC ,  art.active_state ASC   `
+		listIk, e := models.GetActivityListNew(conditionActivityIk, pars, user.UserId, startSizeIk, pageSizeIk, 0, 0, "")
+		if e != nil {
+			err = errors.New("GetActivityonditionList, Err: " + e.Error())
+			return
+		}
+		for _, item := range listIk {
+			list = append(list, item)
+		}
+	}
 
 
 	items, e = HandleActivityListButton(list, user)
 	items, e = HandleActivityListButton(list, user)
 	if e != nil {
 	if e != nil {
 		err = errors.New("HandleActivityListButton, Err: " + e.Error())
 		err = errors.New("HandleActivityListButton, Err: " + e.Error())
 		return
 		return
 	}
 	}
-	total = totalSearche
 	return
 	return
 }
 }
 
 
-//获取 专项调研客户类型   //1、永续客户 //2、大套餐客户(4个行业全开通的正式客户) //8、行业升级套餐客户 //9、其余正式客户;5、试用客户
+// 获取 专项调研客户类型   //1、永续客户 //2、大套餐客户(4个行业全开通的正式客户) //8、行业升级套餐客户 //9、其余正式客户;5、试用客户
 func GetActivitySpecialUserType(companyId int) (userType int, permissionStrnew string, err error) {
 func GetActivitySpecialUserType(companyId int) (userType int, permissionStrnew string, err error) {
 	var permissionStr string
 	var permissionStr string
 	if companyId <= 1 {
 	if companyId <= 1 {
@@ -633,8 +675,8 @@ func GetActivitySpecialUserType(companyId int) (userType int, permissionStrnew s
 	return
 	return
 }
 }
 
 
-//GetSpecialUserType 获取专项产业调研的用户身份类型
-//获取 专项调研客户类型   //1、永续客户 //2、大套餐客户(4个行业全开通的正式客户) //8、行业升级套餐客户 //9、其余正式客户;5、试用客户
+// GetSpecialUserType 获取专项产业调研的用户身份类型
+// 获取 专项调研客户类型   //1、永续客户 //2、大套餐客户(4个行业全开通的正式客户) //8、行业升级套餐客户 //9、其余正式客户;5、试用客户
 func GetSpecialUserType(user *models.WxUserItem) (userType int, err error) {
 func GetSpecialUserType(user *models.WxUserItem) (userType int, err error) {
 	companyId := user.CompanyId
 	companyId := user.CompanyId
 	companyDetail, e := models.GetCompanyDetailByIdGroupTrip(companyId)
 	companyDetail, e := models.GetCompanyDetailByIdGroupTrip(companyId)
@@ -681,7 +723,7 @@ func GetSpecialUserType(user *models.WxUserItem) (userType int, err error) {
 	return
 	return
 }
 }
 
 
-//GetSpecialDetailUserPower 处理用户查看专项调研详情的权限
+// GetSpecialDetailUserPower 处理用户查看专项调研详情的权限
 func GetSpecialDetailUserPower(user *models.WxUserItem, activityInfo *models.CygxActivitySpecialDetail) (havePower bool, err error) {
 func GetSpecialDetailUserPower(user *models.WxUserItem, activityInfo *models.CygxActivitySpecialDetail) (havePower bool, err error) {
 	permissionStr, e := GetCompanyPermissionUpgrade(user.CompanyId)
 	permissionStr, e := GetCompanyPermissionUpgrade(user.CompanyId)
 	if e != nil {
 	if e != nil {
@@ -723,7 +765,7 @@ func GetSpecialDetailUserPower(user *models.WxUserItem, activityInfo *models.Cyg
 	return
 	return
 }
 }
 
 
-//预报名活动,感兴趣人数满10人时,推送给活动负责人和王芳
+// 预报名活动,感兴趣人数满10人时,推送给活动负责人和王芳
 func SendWxMsgActivitySpecial10(activityInfo *models.CygxActivitySpecialDetail) (err error) {
 func SendWxMsgActivitySpecial10(activityInfo *models.CygxActivitySpecialDetail) (err error) {
 	activityId := activityInfo.ActivityId
 	activityId := activityInfo.ActivityId
 	var msg string
 	var msg string

+ 150 - 8
services/elastic.go

@@ -8,6 +8,7 @@ import (
 	"hongze/hongze_clpt/models"
 	"hongze/hongze_clpt/models"
 	"hongze/hongze_clpt/utils"
 	"hongze/hongze_clpt/utils"
 	"strconv"
 	"strconv"
+	"strings"
 )
 )
 
 
 //func NewClient() (client *elastic.Client, err error) {
 //func NewClient() (client *elastic.Client, err error) {
@@ -239,7 +240,7 @@ func EsMultiMatchFunctionScoreQueryTimeSort(indexName, keyWord string, startSize
 	return
 	return
 }
 }
 
 
-func EsArticleSearch(keyWord string, startSize, pageSize int, orderColumn string) (result []*models.SearchItem, total int64, err error) {
+func EsArticleSearch(keyWord string, startSize, pageSize int, orderColumn string, ikType int) (result []*models.SearchItem, total int64, err error) {
 	indexName := utils.IndexName
 	indexName := utils.IndexName
 	client := utils.Client
 	client := utils.Client
 	keyWordArr, err := GetIndustryMapNameSliceV3(keyWord)
 	keyWordArr, err := GetIndustryMapNameSliceV3(keyWord)
@@ -249,37 +250,126 @@ func EsArticleSearch(keyWord string, startSize, pageSize int, orderColumn string
 		keyWordArr = append(keyWordArr, keyWord)
 		keyWordArr = append(keyWordArr, keyWord)
 		keyWordLen = len(keyWordArr)
 		keyWordLen = len(keyWordArr)
 	}
 	}
+	//Es 的高级查询有 自定义排序 文档一时半会儿撸不懂,先做多次查询手动过滤 2023.2.2
+	//ikType 查询方式 ,0:查所有 、 1:查询键入词 、 2:查询除了查询键入词之外的联想词
 	mustMap := make([]interface{}, 0)
 	mustMap := make([]interface{}, 0)
 	shouldMap := make(map[string]interface{}, 0)
 	shouldMap := make(map[string]interface{}, 0)
 	shouldMapquery := make([]interface{}, 0)
 	shouldMapquery := make([]interface{}, 0)
+
+	mustNotMap := make([]interface{}, 0)
+	shouldNotMap := make(map[string]interface{}, 0)
+	shouldNotMapquery := make([]interface{}, 0)
 	// @Param   OrderColumn   query   int  true       "排序字段 ,Comprehensive综合 ,Matching匹配度 ,PublishDate 发布时间 "
 	// @Param   OrderColumn   query   int  true       "排序字段 ,Comprehensive综合 ,Matching匹配度 ,PublishDate 发布时间 "
 	//keyWordWeight := GetWeight(keyWordLen)
 	//keyWordWeight := GetWeight(keyWordLen)
 	var boost int
 	var boost int
-	lenkeyWordArr := len(keyWordArr)
+	//lenkeyWordArr := len(keyWordArr)
 	for k, v := range keyWordArr {
 	for k, v := range keyWordArr {
 		if k == 0 {
 		if k == 0 {
 			boost = 2 * 1000
 			boost = 2 * 1000
 		} else {
 		} else {
-			boost = 1000
+			boost = 1
 		}
 		}
+
+		//如果是 2:查询除了查询键入词之外的联想词
+		if k == 0 && ikType == 2 {
+			if v != "" {
+				shouldNotMapquery = append(shouldNotMapquery, map[string]interface{}{
+					"function_score": map[string]interface{}{
+						"query": map[string]interface{}{
+							"multi_match": map[string]interface{}{
+								//"boost":  (lenkeyWordArr - k) * boost, //给查询的值赋予权重
+								"boost":  boost, //给查询的值赋予权重
+								"fields": []interface{}{"Title"},
+								"query":  v,
+							},
+						},
+					},
+				})
+				shouldNotMapquery = append(shouldNotMapquery, map[string]interface{}{
+					"function_score": map[string]interface{}{
+						"query": map[string]interface{}{
+							"multi_match": map[string]interface{}{
+								"boost":  boost, //给查询的值赋予权重
+								"fields": []interface{}{"Abstract"},
+								"query":  v,
+							},
+						},
+					},
+				})
+				shouldNotMapquery = append(shouldNotMapquery, map[string]interface{}{
+					"function_score": map[string]interface{}{
+						"query": map[string]interface{}{
+							"multi_match": map[string]interface{}{
+								"boost":  boost, //给查询的值赋予权重
+								"fields": []interface{}{"Annotation"},
+								"query":  v,
+							},
+						},
+					},
+				})
+
+				shouldNotMapquery = append(shouldNotMapquery, map[string]interface{}{
+					"function_score": map[string]interface{}{
+						"query": map[string]interface{}{
+							"multi_match": map[string]interface{}{
+								//"boost":  (lenkeyWordArr-k)*boost - 1, //给查询的值赋予权重
+								"boost":  boost, //给查询的值赋予权重
+								"fields": []interface{}{"BodyText"},
+								"query":  v,
+							},
+						},
+					},
+				})
+			}
+			continue
+		}
+		//如果是 1:查询键入词
+		if k > 0 && ikType == 1 {
+			continue
+		}
+
 		if v != "" {
 		if v != "" {
 			shouldMapquery = append(shouldMapquery, map[string]interface{}{
 			shouldMapquery = append(shouldMapquery, map[string]interface{}{
 				"function_score": map[string]interface{}{
 				"function_score": map[string]interface{}{
 					"query": map[string]interface{}{
 					"query": map[string]interface{}{
 						"multi_match": map[string]interface{}{
 						"multi_match": map[string]interface{}{
-							"boost":  (lenkeyWordArr - k) * boost, //给查询的值赋予权重
+							//"boost":  (lenkeyWordArr - k) * boost, //给查询的值赋予权重
+							"boost":  boost, //给查询的值赋予权重
 							"fields": []interface{}{"Title"},
 							"fields": []interface{}{"Title"},
 							"query":  v,
 							"query":  v,
 						},
 						},
 					},
 					},
 				},
 				},
 			})
 			})
+			shouldMapquery = append(shouldMapquery, map[string]interface{}{
+				"function_score": map[string]interface{}{
+					"query": map[string]interface{}{
+						"multi_match": map[string]interface{}{
+							"boost":  boost, //给查询的值赋予权重
+							"fields": []interface{}{"Abstract"},
+							"query":  v,
+						},
+					},
+				},
+			})
+			shouldMapquery = append(shouldMapquery, map[string]interface{}{
+				"function_score": map[string]interface{}{
+					"query": map[string]interface{}{
+						"multi_match": map[string]interface{}{
+							"boost":  boost, //给查询的值赋予权重
+							"fields": []interface{}{"Annotation"},
+							"query":  v,
+						},
+					},
+				},
+			})
 
 
 			shouldMapquery = append(shouldMapquery, map[string]interface{}{
 			shouldMapquery = append(shouldMapquery, map[string]interface{}{
 				"function_score": map[string]interface{}{
 				"function_score": map[string]interface{}{
 					"query": map[string]interface{}{
 					"query": map[string]interface{}{
 						"multi_match": map[string]interface{}{
 						"multi_match": map[string]interface{}{
-							"boost":  (lenkeyWordArr-k)*boost - 1, //给查询的值赋予权重
+							//"boost":  (lenkeyWordArr-k)*boost - 1, //给查询的值赋予权重
+							"boost":  boost, //给查询的值赋予权重
 							"fields": []interface{}{"BodyText"},
 							"fields": []interface{}{"BodyText"},
 							"query":  v,
 							"query":  v,
 						},
 						},
@@ -291,20 +381,32 @@ func EsArticleSearch(keyWord string, startSize, pageSize int, orderColumn string
 	shouldMap = map[string]interface{}{
 	shouldMap = map[string]interface{}{
 		"should": shouldMapquery,
 		"should": shouldMapquery,
 	}
 	}
+
+	shouldNotMap = map[string]interface{}{
+		"should": shouldNotMapquery,
+	}
 	//排序
 	//排序
 	sortMap := make([]interface{}, 0)
 	sortMap := make([]interface{}, 0)
+
 	//时间
 	//时间
 	sortMap = append(sortMap, map[string]interface{}{
 	sortMap = append(sortMap, map[string]interface{}{
 		"PublishDate": map[string]interface{}{
 		"PublishDate": map[string]interface{}{
 			"order": "desc",
 			"order": "desc",
 		},
 		},
 	})
 	})
+	//sortMap = append(sortMap, map[string]interface{}{
+	//	"_score": map[string]interface{}{
+	//		"order": "desc",
+	//	},
+	//})
 	//高亮
 	//高亮
 	highlightMap := make(map[string]interface{}, 0)
 	highlightMap := make(map[string]interface{}, 0)
 	highlightMap = map[string]interface{}{
 	highlightMap = map[string]interface{}{
 		"fields": map[string]interface{}{
 		"fields": map[string]interface{}{
-			"BodyText": map[string]interface{}{},
-			"Title":    map[string]interface{}{},
+			"BodyText":   map[string]interface{}{},
+			"Title":      map[string]interface{}{},
+			"Abstract":   map[string]interface{}{},
+			"Annotation": map[string]interface{}{},
 		},
 		},
 		//样式 红色
 		//样式 红色
 		"post_tags": []interface{}{"</font>"},
 		"post_tags": []interface{}{"</font>"},
@@ -314,6 +416,10 @@ func EsArticleSearch(keyWord string, startSize, pageSize int, orderColumn string
 	mustMap = append(mustMap, map[string]interface{}{
 	mustMap = append(mustMap, map[string]interface{}{
 		"bool": shouldMap,
 		"bool": shouldMap,
 	})
 	})
+	mustNotMap = append(mustNotMap, map[string]interface{}{
+		"bool": shouldNotMap,
+	})
+
 	queryMap := map[string]interface{}{
 	queryMap := map[string]interface{}{
 		"query": map[string]interface{}{
 		"query": map[string]interface{}{
 			"bool": map[string]interface{}{
 			"bool": map[string]interface{}{
@@ -321,7 +427,18 @@ func EsArticleSearch(keyWord string, startSize, pageSize int, orderColumn string
 			},
 			},
 		},
 		},
 	}
 	}
-	if orderColumn == "PublishDate" {
+	//把第一次键入词的筛选条件过滤掉
+	if ikType == 2 {
+		queryMap = map[string]interface{}{
+			"query": map[string]interface{}{
+				"bool": map[string]interface{}{
+					"must":     mustMap,
+					"must_not": mustNotMap,
+				},
+			},
+		}
+	}
+	if orderColumn == "Matching" {
 		queryMap["sort"] = sortMap
 		queryMap["sort"] = sortMap
 	}
 	}
 	queryMap["from"] = startSize
 	queryMap["from"] = startSize
@@ -329,6 +446,7 @@ func EsArticleSearch(keyWord string, startSize, pageSize int, orderColumn string
 	queryMap["highlight"] = highlightMap
 	queryMap["highlight"] = highlightMap
 	jsonBytes, _ := json.Marshal(queryMap)
 	jsonBytes, _ := json.Marshal(queryMap)
 	fmt.Println(string(jsonBytes))
 	fmt.Println(string(jsonBytes))
+	//utils.FileLog.Info(string(jsonBytes))
 	request := client.Search(indexName).Source(queryMap) // sets the JSON request
 	request := client.Search(indexName).Source(queryMap) // sets the JSON request
 	searchByMatch, err := request.Do(context.Background())
 	searchByMatch, err := request.Do(context.Background())
 	if searchByMatch != nil {
 	if searchByMatch != nil {
@@ -381,3 +499,27 @@ func EsArticleSearch(keyWord string, startSize, pageSize int, orderColumn string
 	}
 	}
 	return
 	return
 }
 }
+
+// KeyWordArrSqlRegexp 预处理ik联想词的模糊查询语句
+func KeyWordArrSqlRegexpAll(a []string) (ret string) {
+	a_len := len(a)
+	for i := 0; i < a_len; i++ {
+		ret += a[i] + "|"
+	}
+	ret = strings.TrimRight(ret, "|")
+	//ret = "'" + ret + "'"
+	return
+}
+
+// KeyWordArrSqlRegexp 预处理ik联想词的模糊查询语句
+func KeyWordArrSqlRegexp(a []string) (ret string) {
+	a_len := len(a)
+	for i := 0; i < a_len; i++ {
+		if i == 0 {
+			continue
+		}
+		ret += a[i] + "|"
+	}
+	ret = strings.TrimRight(ret, "|")
+	return
+}

+ 223 - 49
services/micro_roadshow.go

@@ -5,7 +5,6 @@ import (
 	"errors"
 	"errors"
 	"hongze/hongze_clpt/models"
 	"hongze/hongze_clpt/models"
 	"hongze/hongze_clpt/utils"
 	"hongze/hongze_clpt/utils"
-	"strings"
 )
 )
 
 
 // GetMicroRoadShowDefaultImgConfig 获取微路演默认图/分享图配置
 // GetMicroRoadShowDefaultImgConfig 获取微路演默认图/分享图配置
@@ -106,7 +105,7 @@ func GetindustryVideo(user *models.WxUserItem, industrialManagementId int) (indu
 	return
 	return
 }
 }
 
 
-//GetindustryVideoDetailById 通过视频ID获取视频详情
+// GetindustryVideoDetailById 通过视频ID获取视频详情
 func GetindustryVideoDetailById(user *models.WxUserItem, videoId int) (industryVideo *models.MicroVideoSimpleInfo, AuthInfo *models.UserPermissionAuthInfo, err error) {
 func GetindustryVideoDetailById(user *models.WxUserItem, videoId int) (industryVideo *models.MicroVideoSimpleInfo, AuthInfo *models.UserPermissionAuthInfo, err error) {
 	total, e := models.GetMicroRoadshowVideoByVideoIdCount(videoId)
 	total, e := models.GetMicroRoadshowVideoByVideoIdCount(videoId)
 	if e != nil {
 	if e != nil {
@@ -172,7 +171,7 @@ func GetindustryVideoDetailById(user *models.WxUserItem, videoId int) (industryV
 	return
 	return
 }
 }
 
 
-//GetMicroRoadshowVideoMap 获取已经发布的微路演的产业ID
+// GetMicroRoadshowVideoMap 获取已经发布的微路演的产业ID
 func GetMicroRoadshowVideoMap() (items map[int]int, err error) {
 func GetMicroRoadshowVideoMap() (items map[int]int, err error) {
 	list, e := models.GetMicroRoadshowVideoList()
 	list, e := models.GetMicroRoadshowVideoList()
 	if e != nil && e.Error() != utils.ErrNoRow() {
 	if e != nil && e.Error() != utils.ErrNoRow() {
@@ -201,59 +200,65 @@ func GetMicroRoadShowPageListV8(pageSize, currentIndex, audioId, videoId, activi
 	var audioCond string
 	var audioCond string
 	var audioPars []interface{}
 	var audioPars []interface{}
 	// 如果筛选条件为指定视频ID或只看视频则不做音频查询
 	// 如果筛选条件为指定视频ID或只看视频则不做音频查询
-	// @Param   Filter			query	string		false	"筛选条件 为空:全部 1:视频 2:音频 3:逻辑解析 4:路演回放 多个用 , 隔开"
-	if (videoId > 0 || activityVideoId > 0 || (!strings.Contains(filter, "2") && !strings.Contains(filter, "4"))) && filter != "" {
-		audioCond += ` AND a.activity_voice_id = 0 `
-	} else {
-		// 活动已发布且已结束
-		audioCond += ` AND b.publish_status = 1 AND b.active_state = 3`
-		//活动音频,设置有效时间为30天,失效后该活动就不再支持音频回放。有效期起始时间为活动的开始时间
-		//endTime := time.Now().AddDate(0, 0, -30).Format("2006-01-02 15:04:05")
-		//audioCond += ` AND b.activity_time > ? `
-		//audioPars = append(audioPars, endTime)
-		if keywords != "" {
-			audioCond += ` AND a.voice_name LIKE ? OR b.label LIKE ?`
-			audioPars = append(audioPars, keywords, keywords)
-		}
 
 
-		if audioId > 0 {
-			audioCond += ` AND a.activity_voice_id = ?`
-			audioPars = append(audioPars, audioId)
-		}
+	// 活动已发布且已结束
+	audioCond += ` AND b.publish_status = 1 AND b.active_state = 3`
+	//活动音频,设置有效时间为30天,失效后该活动就不再支持音频回放。有效期起始时间为活动的开始时间
+	//endTime := time.Now().AddDate(0, 0, -30).Format("2006-01-02 15:04:05")
+	//audioCond += ` AND b.activity_time > ? `
+	//audioPars = append(audioPars, endTime)
+	if keywords != "" {
+		audioCond += ` AND ( a.voice_name LIKE ? OR b.label LIKE ? )`
+		audioPars = append(audioPars, keywords, keywords)
 	}
 	}
-	//活动视频的处理
-	var videoCondAct string
-	var videoParsAct []interface{}
-	if (audioId > 0 || videoId > 0 || (!strings.Contains(filter, "1") && !strings.Contains(filter, "4"))) && filter != "" {
-		videoCondAct = "AND video_id =  0 "
-	} else {
-		if keywords != "" {
-			videoCondAct += ` AND video_name LIKE ?`
-			videoParsAct = append(videoParsAct, keywords)
-		}
-		if activityVideoId > 0 {
-			videoCondAct += ` AND video_id = ?`
-			videoParsAct = append(videoParsAct, activityVideoId)
-		}
-		videoCondAct += ` AND publish_status = 1`
+	if audioId > 0 {
+		audioCond += ` AND a.activity_voice_id = ?`
+		audioPars = append(audioPars, audioId)
 	}
 	}
-	//产业视频的处理
+
+	//}
+	//视频的处理
 	var videoCond string
 	var videoCond string
+	var videoCondAct string
 	var videoPars []interface{}
 	var videoPars []interface{}
-	if (audioId > 0 || videoId > 0 || (!strings.Contains(filter, "1") && !strings.Contains(filter, "3"))) && filter != "" {
-		videoCond += ` AND video_id =  0 `
-	} else {
-		if keywords != "" {
-			videoCond += ` AND video_name LIKE ?`
-			videoPars = append(videoPars, keywords)
-		}
-		if videoId > 0 {
-			videoCond += ` AND video_id = ?`
-			videoPars = append(videoPars, videoId)
-		}
+	var videoParsAct []interface{}
 
 
-		videoCond += ` AND publish_status = 1`
+	if keywords != "" {
+		videoCond += ` AND video_name LIKE ?`
+		videoPars = append(videoPars, keywords)
+		videoCondAct += ` AND ( video_name LIKE ? OR art.label LIKE ? )`
+		videoParsAct = append(videoParsAct, keywords, keywords)
 	}
 	}
+	if videoId > 0 {
+		videoCond += ` AND video_id = ?`
+		videoPars = append(videoPars, videoId)
+	}
+	if activityVideoId > 0 {
+		videoCondAct += ` AND video_id = ?`
+		videoParsAct = append(videoParsAct, activityVideoId)
+	}
+
+	//如果传了路演的或者活动的视频ID只查询一个
+	if videoId > 0 {
+		videoCondAct += ` AND video_id = 0 `
+		audioCond += ` AND a.activity_voice_id = 0 `
+	}
+	if activityVideoId > 0 {
+		videoCond += ` AND video_id = 0 `
+		audioCond += ` AND a.activity_voice_id = 0 `
+	}
+	if audioId > 0 {
+		videoCondAct += ` AND video_id = 0 `
+		videoCond += ` AND video_id = 0 `
+	}
+	if filter == "1" {
+		audioCond += ` AND a.activity_voice_id = 0 `
+	} else if filter == "2" {
+		videoCondAct += ` AND video_id = 0 `
+		videoCond += ` AND video_id = 0 `
+	}
+
+	videoCond += ` AND publish_status = 1`
 	total, videoList, e = models.GetMicroRoadShowVideoPageListV8(startSize, pageSize, videoCond, videoPars, videoCondAct, videoParsAct, audioCond, audioPars, audioId, videoId, activityVideoId, 0)
 	total, videoList, e = models.GetMicroRoadShowVideoPageListV8(startSize, pageSize, videoCond, videoPars, videoCondAct, videoParsAct, audioCond, audioPars, audioId, videoId, activityVideoId, 0)
 	if e != nil {
 	if e != nil {
 		err = errors.New("获取微路演音视频列表失败, Err: " + e.Error())
 		err = errors.New("获取微路演音视频列表失败, Err: " + e.Error())
@@ -292,3 +297,172 @@ func GetMicroRoadShowPageListV8(pageSize, currentIndex, audioId, videoId, activi
 	respList = videoList
 	respList = videoList
 	return
 	return
 }
 }
+
+// GetMicroRoadShowPageListIkWord  添加IK分词联想词 获取微路演列表添加活动视频 更新与8.1版本
+func CountMicroRoadShowPageListIkWord(audioId, videoId, activityVideoId int, keywordArr []string, filter string) (total int, err error) {
+	var e error
+	var keywords string
+	if len(keywordArr) > 0 {
+		keywords = KeyWordArrSqlRegexpAll(keywordArr)
+	}
+	//if keywords == "" {
+	//	return
+	//}
+	//音频的查询
+	var audioCond string
+	var audioPars []interface{}
+	// 如果筛选条件为指定视频ID或只看视频则不做音频查询
+	//if videoId > 0 || activityVideoId > 0 || filter == 1 {
+	//	audioCond += ` AND a.activity_voice_id  = 0 `
+	//} else {
+	// 活动已发布且已结束
+	audioCond += ` AND b.publish_status = 1 AND b.active_state = 3`
+	if keywords != "" {
+		audioCond += ` AND (a.voice_name REGEXP ? OR b.label REGEXP ? ) `
+		audioPars = append(audioPars, keywords, keywords)
+	}
+	if audioId > 0 {
+		audioCond += ` AND a.activity_voice_id = ?`
+		audioPars = append(audioPars, audioId)
+	}
+
+	//视频的处理
+	var videoCond string
+	var videoCondAct string
+	var videoPars []interface{}
+	var videoParsAct []interface{}
+	//if audioId > 0 || filter == 2 {
+	//	videoCond = ""
+	//} else {
+	if keywords != "" {
+		videoCond += ` AND video_name REGEXP ?`
+		videoPars = append(videoPars, keywords)
+		videoCondAct += ` AND ( video_name REGEXP ?  OR art.label REGEXP ? )`
+		videoParsAct = append(videoParsAct, keywords, keywords)
+	}
+	if videoId > 0 {
+		videoCond += ` AND video_id = ?`
+		videoPars = append(videoPars, videoId)
+	}
+	if activityVideoId > 0 {
+		videoCondAct += ` AND video_id = ?`
+		videoParsAct = append(videoParsAct, activityVideoId)
+	}
+
+	//如果传了路演的或者活动的视频ID只查询一个
+	if videoId > 0 {
+		videoCondAct += ` AND video_id = 0 `
+		audioCond += ` AND a.activity_voice_id = 0 `
+	}
+	if activityVideoId > 0 {
+		videoCond += ` AND video_id = 0 `
+		audioCond += ` AND a.activity_voice_id = 0 `
+	}
+	if audioId > 0 {
+		videoCondAct += ` AND video_id = 0 `
+		videoCond += ` AND video_id = 0 `
+	}
+	if filter == "1" {
+		audioCond += ` AND a.activity_voice_id = 0 `
+	} else if filter == "2" {
+		videoCondAct += ` AND video_id = 0 `
+		videoCond += ` AND video_id = 0 `
+	}
+
+	videoCond += ` AND publish_status = 1`
+	//}
+	total, e = models.CountMicroRoadShowVideoPageList(videoCond, videoPars, videoCondAct, videoParsAct, audioCond, audioPars)
+	if e != nil {
+		err = errors.New("获取微路演音视频列表失败, Err: " + e.Error())
+		return
+	}
+	return
+}
+
+// GetMicroRoadShowPageListIkWord  添加IK分词联想词 获取微路演列表添加活动视频 更新与8.1版本
+func GetMicroRoadShowPageListIkWord(startSize, pageSize, audioId, videoId, activityVideoId int, keywordArr []string, filter, keywords string) (respList []*models.MicroRoadShowPageList, err error) {
+
+	videoList := make([]*models.MicroRoadShowPageList, 0)
+	var e error
+	var keywordsIk string
+	if len(keywordArr) > 1 {
+		keywordsIk = KeyWordArrSqlRegexp(keywordArr)
+	}
+	if keywords != "" {
+		keywords = "%" + keywords + "%"
+	}
+	//音频的查询
+	var audioCond string
+	var audioPars []interface{}
+	// 如果筛选条件为指定视频ID或只看视频则不做音频查询
+	//if videoId > 0 || activityVideoId > 0 || filter == 1 {
+	//	audioCond += ` AND a.activity_voice_id  = 0 `
+	//} else {
+	// 活动已发布且已结束
+	audioCond += ` AND b.publish_status = 1 AND b.active_state = 3`
+	if keywordsIk != "" {
+		audioCond += ` AND ( a.voice_name REGEXP ? OR b.label REGEXP ? )`
+		audioCond += ` AND ( a.voice_name NOT LIKE ? AND  b.label NOT LIKE ? )`
+		audioPars = append(audioPars, keywordsIk, keywordsIk, keywords, keywords)
+	}
+	if audioId > 0 {
+		audioCond += ` AND a.activity_voice_id = ?`
+		audioPars = append(audioPars, audioId)
+	}
+
+	//视频的处理
+	var videoCond string
+	var videoCondAct string
+	var videoPars []interface{}
+	var videoParsAct []interface{}
+	//if audioId > 0 || filter == 2 {
+	//	videoCond = ""
+	//} else {
+	if keywordsIk != "" {
+		videoCond += ` AND video_name REGEXP ?`
+		videoPars = append(videoPars, keywordsIk)
+
+		videoCondAct += ` AND ( v.video_name REGEXP ? OR art.label REGEXP ? )`
+		videoCondAct += ` AND ( v.video_name NOT LIKE ? AND art.label NOT LIKE ? )`
+
+		videoParsAct = append(videoParsAct, keywordsIk, keywordsIk, keywords, keywords)
+	}
+	if videoId > 0 {
+		videoCond += ` AND video_id = ?`
+		videoPars = append(videoPars, videoId)
+	}
+	if activityVideoId > 0 {
+		videoCondAct += ` AND video_id = ?`
+		videoParsAct = append(videoParsAct, activityVideoId)
+	}
+
+	//如果传了路演的或者活动的视频ID只查询一个
+	if videoId > 0 {
+		videoCondAct += ` AND video_id = 0 `
+		audioCond += ` AND a.activity_voice_id = 0 `
+	}
+	if activityVideoId > 0 {
+		videoCond += ` AND video_id = 0 `
+		audioCond += ` AND a.activity_voice_id = 0 `
+	}
+	if audioId > 0 {
+		videoCondAct += ` AND video_id = 0 `
+		videoCond += ` AND video_id = 0 `
+	}
+	if filter == "1" {
+		audioCond += ` AND a.activity_voice_id = 0 `
+	} else if filter == "2" {
+		videoCondAct += ` AND video_id = 0 `
+		videoCond += ` AND video_id = 0 `
+	}
+
+	videoCond += ` AND publish_status = 1`
+	//}
+	videoList, e = models.GetMicroRoadShowVideoPageListIkWord(startSize, pageSize, videoCond, videoPars, videoCondAct, videoParsAct, audioCond, audioPars, audioId, videoId, activityVideoId, 0)
+	if e != nil {
+		err = errors.New("获取微路演音视频列表失败分词, Err: " + e.Error())
+		return
+	}
+	respList = videoList
+	return
+}

+ 1 - 1
services/resource_data.go

@@ -125,7 +125,7 @@ func GetResourceDataList(condition string, pars []interface{}, startSize, pageSi
 		pars = make([]interface{}, 0)
 		pars = make([]interface{}, 0)
 		condition = ` AND art.activity_id IN (` + utils.GetOrmInReplace(len(activityIds)) + `)   `
 		condition = ` AND art.activity_id IN (` + utils.GetOrmInReplace(len(activityIds)) + `)   `
 		pars = append(pars, activityIds)
 		pars = append(pars, activityIds)
-		activityList, e := models.GetActivityListNew(condition, pars, uid, 0, len(activityIds), 0, 0)
+		activityList, e := models.GetActivityListNew(condition, pars, uid, 0, len(activityIds), 0, 0, "")
 		if e != nil {
 		if e != nil {
 			err = errors.New("GetResourceDataList, Err: " + e.Error())
 			err = errors.New("GetResourceDataList, Err: " + e.Error())
 			return
 			return

+ 3 - 3
utils/config.go

@@ -17,7 +17,7 @@ var (
 	Re          error        //redis错误
 	Re          error        //redis错误
 )
 )
 
 
-//微信配置信息
+// 微信配置信息
 var (
 var (
 	WxId        string //微信原始ID
 	WxId        string //微信原始ID
 	WxAppId     string //查研观向小程序
 	WxAppId     string //查研观向小程序
@@ -45,7 +45,7 @@ var (
 	YiDonggetOriginalLink    string //易董 短连接转为长链接
 	YiDonggetOriginalLink    string //易董 短连接转为长链接
 )
 )
 
 
-//模板消息推送
+// 模板消息推送
 var (
 var (
 	SendWxTemplateMsgUrl string
 	SendWxTemplateMsgUrl string
 )
 )
@@ -99,7 +99,7 @@ func init() {
 		WxOpenAppId = "wx26ccbe242908ed73"                   //公众平台AppId
 		WxOpenAppId = "wx26ccbe242908ed73"                   //公众平台AppId
 		WxOpenAppSecret = "0851cc85027c6eb74a400016648ecda8" //公众平台AppSecret
 		WxOpenAppSecret = "0851cc85027c6eb74a400016648ecda8" //公众平台AppSecret
 
 
-		IndexName = "cygx_article_v1213"
+		IndexName = "cygx_article_v02_01"
 		ActSendMsgMobile = "15618524605"
 		ActSendMsgMobile = "15618524605"
 	} else {
 	} else {
 		WxPublicAppId = "wx9b5d7291e581233a"                                          //弘则投研公众号 开发者ID(AppID)
 		WxPublicAppId = "wx9b5d7291e581233a"                                          //弘则投研公众号 开发者ID(AppID)

+ 10 - 9
utils/constants.go

@@ -4,7 +4,7 @@ const (
 	Md5Key = "Ks@h64WJ#tcVgG8$&WlNfqvLAtMgpxWN"
 	Md5Key = "Ks@h64WJ#tcVgG8$&WlNfqvLAtMgpxWN"
 )
 )
 
 
-//常量定义
+// 常量定义
 const (
 const (
 	FormatTime             = "15:04:05"                //时间格式
 	FormatTime             = "15:04:05"                //时间格式
 	FormatDate             = "2006-01-02"              //日期格式
 	FormatDate             = "2006-01-02"              //日期格式
@@ -29,14 +29,14 @@ const (
 	REGISTER_PLATFORM   = 2 // 来源 1小程序,2:网页
 	REGISTER_PLATFORM   = 2 // 来源 1小程序,2:网页
 )
 )
 
 
-//手机号,电子邮箱正则
+// 手机号,电子邮箱正则
 const (
 const (
 	RegularMobile         = "^((13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(18[0-9])|(17[0-9])|(16[0-9])|(19[0-9]))\\d{8}$" //手机号码
 	RegularMobile         = "^((13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(18[0-9])|(17[0-9])|(16[0-9])|(19[0-9]))\\d{8}$" //手机号码
 	RegularFixedTelephone = "^(\\(\\d{3,4}\\)|\\d{3,4}-|\\s)?\\d{7,14}$"                                              //手机号码
 	RegularFixedTelephone = "^(\\(\\d{3,4}\\)|\\d{3,4}-|\\s)?\\d{7,14}$"                                              //手机号码
 	RegularEmail          = `\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*`                                             //匹配电子邮箱
 	RegularEmail          = `\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*`                                             //匹配电子邮箱
 )
 )
 
 
-//聚合短信
+// 聚合短信
 var (
 var (
 	JhGnTplId = "65692" //聚合国内模板编码
 	JhGnTplId = "65692" //聚合国内模板编码
 	JhGjTplId = "10054" //聚合国内模板编码
 	JhGjTplId = "10054" //聚合国内模板编码
@@ -45,7 +45,7 @@ var (
 	JhGjAppKey = "3326ad2c1047a4cd92ace153e6044ca3"
 	JhGjAppKey = "3326ad2c1047a4cd92ace153e6044ca3"
 )
 )
 
 
-//OSS
+// OSS
 var (
 var (
 	Endpoint   string = "oss-cn-shanghai.aliyuncs.com"
 	Endpoint   string = "oss-cn-shanghai.aliyuncs.com"
 	Bucketname string = "hongze"
 	Bucketname string = "hongze"
@@ -84,9 +84,10 @@ const (
 	OnlineTime                       string = "2021-06-01 00:00:01" //上线时间
 	OnlineTime                       string = "2021-06-01 00:00:01" //上线时间
 	HONG_GUAN_ID                     int    = 1
 	HONG_GUAN_ID                     int    = 1
 	HZ_COMPANY_ID                    int    = 16
 	HZ_COMPANY_ID                    int    = 16
+	YAN_XUAN_ARTICLE_TYPE_IDS        string = "1,2,12" // 属于研选的报告类型ID
 )
 )
 
 
-//模板消息推送类型
+// 模板消息推送类型
 const (
 const (
 	TEMPLATE_MSG_CYGX_ACTIVITY_ADD = 12 //查研观向小程序活动更新推送 12
 	TEMPLATE_MSG_CYGX_ACTIVITY_ADD = 12 //查研观向小程序活动更新推送 12
 	TEMPLATE_MSG_CYGX_ARTICLE_ADD  = 13 //查研观向报告更新推送  13
 	TEMPLATE_MSG_CYGX_ARTICLE_ADD  = 13 //查研观向报告更新推送  13
@@ -104,7 +105,7 @@ const (
 	TIME_CATEGORYID = 99999 //时间线的分类ID
 	TIME_CATEGORYID = 99999 //时间线的分类ID
 )
 )
 
 
-//活动相关
+// 活动相关
 const (
 const (
 	C_CLASS_ACTIVITY_TYPE_ID      int = 7 //C类电话会会议ID
 	C_CLASS_ACTIVITY_TYPE_ID      int = 7 //C类电话会会议ID
 	ANALYST_TELL_ACTIVITY_TYPE_ID int = 2 //分析师电话会ID
 	ANALYST_TELL_ACTIVITY_TYPE_ID int = 2 //分析师电话会ID
@@ -133,20 +134,20 @@ const (
 	ACTIVITY_ZXDY_ImgUrl3 = "https://hzstatic.hzinsights.com/cygx/special_list_bg.png"
 	ACTIVITY_ZXDY_ImgUrl3 = "https://hzstatic.hzinsights.com/cygx/special_list_bg.png"
 )
 )
 
 
-//模板消息地址路由
+// 模板消息地址路由
 const (
 const (
 	ACtIVITY_SPECIAL_EXPLAIN      = "此类调研具体行程尚未确定,待预报名人数满10人后弘则会确定行程并推送给您活动日期,只有在确定行程中再次报名才完成占位。"                        //专项调研说明
 	ACtIVITY_SPECIAL_EXPLAIN      = "此类调研具体行程尚未确定,待预报名人数满10人后弘则会确定行程并推送给您活动日期,只有在确定行程中再次报名才完成占位。"                        //专项调研说明
 	ACtIVITY_SPECIAL_TRIP_EXPLAIN = "此类调研时间安排已经确定,点击报名后按人次扣除对应机构的服务点数。由于每场活动人数有限,如果不能参加请提前48小时取消,未及时取消导致影响其他客户报名将会维持扣点。" //专项调研说明
 	ACtIVITY_SPECIAL_TRIP_EXPLAIN = "此类调研时间安排已经确定,点击报名后按人次扣除对应机构的服务点数。由于每场活动人数有限,如果不能参加请提前48小时取消,未及时取消导致影响其他客户报名将会维持扣点。" //专项调研说明
 
 
 )
 )
 
 
-//模板消息地址路由
+// 模板消息地址路由
 const (
 const (
 	WX_MSG_PATH_ARTICLE_DETAIL          = "pageMy/reportDetail/reportDetail?id="          //文章详情模板消息地址
 	WX_MSG_PATH_ARTICLE_DETAIL          = "pageMy/reportDetail/reportDetail?id="          //文章详情模板消息地址
 	WX_MSG_PATH_ACTIVITY_SPECIAL_DETAIL = "activityPages/specialDetail/specialDetail?id=" //专项调研活动模板消息地址
 	WX_MSG_PATH_ACTIVITY_SPECIAL_DETAIL = "activityPages/specialDetail/specialDetail?id=" //专项调研活动模板消息地址
 )
 )
 
 
-//微信模板消息推送公共接口的秘钥
+// 微信模板消息推送公共接口的秘钥
 const (
 const (
 	SendTemplateMsgAuthorization = "dc855fce962a639faa779cbdd4cd332f"
 	SendTemplateMsgAuthorization = "dc855fce962a639faa779cbdd4cd332f"
 )
 )