|
@@ -360,6 +360,16 @@ func (this *ActivityCoAntroller) ActivityList() {
|
|
|
keyWordItem.PageType = "ActivitSearch"
|
|
|
keyWordItem.CreateTime = time.Now()
|
|
|
go models.AddUserSearchKeyWord(keyWordItem)
|
|
|
+
|
|
|
+ cacheKey := fmt.Sprint("Search_uid:", user.UserId, "_KeyWord:", keyWordSearch, "_Source:", 6)
|
|
|
+ isExist := utils.Rc.IsExist(cacheKey)
|
|
|
+ if !isExist {
|
|
|
+ setNX := utils.Rc.SetNX(cacheKey, keyWordSearch, time.Minute*1)
|
|
|
+ if !setNX {
|
|
|
+ go utils.SendAlarmMsg("记录用户搜索活动关键词失败,设置Redis Key 过期时间失败:key"+cacheKey, 3)
|
|
|
+ }
|
|
|
+ go services.AddUserSearchLog(user, keyWordSearch, 6)
|
|
|
+ }
|
|
|
}
|
|
|
page := paging.GetPaging(currentIndex, pageSize, total)
|
|
|
resp := new(models.GetCygxActivityListRep)
|
|
@@ -3434,53 +3444,55 @@ func (this *ActivityCoAntroller) LabelTypeListV5() {
|
|
|
|
|
|
//userType = 1
|
|
|
//查询专项产业调研展示权限
|
|
|
- var condition string
|
|
|
- condition = ` AND art.publish_status = 1 AND art.label != '' `
|
|
|
- if isPower == 1 {
|
|
|
- condition += permissionSqlStr
|
|
|
- }
|
|
|
- //行业名称
|
|
|
- if len(chartPermissionIds) > 0 {
|
|
|
- condition += ` AND art.chart_permission_id IN (` + chartPermissionIds + `)`
|
|
|
- }
|
|
|
- var conditionOr string
|
|
|
+ if whichDay == "" {
|
|
|
+ var condition string
|
|
|
+ condition = ` AND art.publish_status = 1 AND art.label != '' `
|
|
|
+ if isPower == 1 {
|
|
|
+ condition += permissionSqlStr
|
|
|
+ }
|
|
|
+ //行业名称
|
|
|
+ if len(chartPermissionIds) > 0 {
|
|
|
+ condition += ` AND art.chart_permission_id IN (` + chartPermissionIds + `)`
|
|
|
+ }
|
|
|
+ var conditionOr string
|
|
|
|
|
|
- if (userType == 2 || userType == 3 || userType == 4) && strings.Contains(permissionStr, "专家") {
|
|
|
- conditionOr += ` OR (1=1 AND art.customer_type_ids LIKE '%4%' ` + condition + `) `
|
|
|
- }
|
|
|
- if (userType == 5) && strings.Contains(permissionStr, "专家") {
|
|
|
- conditionOr += ` OR (1=1 AND art.customer_type_ids LIKE '%5%' ` + condition + `) `
|
|
|
- }
|
|
|
- if userType == 1 {
|
|
|
- conditionOr += ` OR (1=1 ` + condition + permissionSqlStr + `) `
|
|
|
- }
|
|
|
+ if (userType == 2 || userType == 3 || userType == 4) && strings.Contains(permissionStr, "专家") {
|
|
|
+ conditionOr += ` OR (1=1 AND art.customer_type_ids LIKE '%4%' ` + condition + `) `
|
|
|
+ }
|
|
|
+ if (userType == 5) && strings.Contains(permissionStr, "专家") {
|
|
|
+ conditionOr += ` OR (1=1 AND art.customer_type_ids LIKE '%5%' ` + condition + `) `
|
|
|
+ }
|
|
|
+ if userType == 1 {
|
|
|
+ conditionOr += ` OR (1=1 ` + condition + permissionSqlStr + `) `
|
|
|
+ }
|
|
|
|
|
|
- if companyProduct != nil {
|
|
|
- if companyProduct.Scale != "" {
|
|
|
- conditionOr += ` OR ( art.scale LIKE '%` + companyProduct.Scale + `%' ` + condition + `) `
|
|
|
+ if companyProduct != nil {
|
|
|
+ if companyProduct.Scale != "" {
|
|
|
+ conditionOr += ` OR ( art.scale LIKE '%` + companyProduct.Scale + `%' ` + condition + `) `
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- condition += sqlExport + conditionOr
|
|
|
- specialList, err := models.GetActivityLabelSpecialListAll(condition, pars, startSize, 8)
|
|
|
- if err != nil {
|
|
|
- br.Msg = "获取失败"
|
|
|
- br.ErrMsg = "获取失败,Err:" + err.Error()
|
|
|
- return
|
|
|
- }
|
|
|
- for k2, v2 := range specialList {
|
|
|
- specialList[k2].KeyWord = services.LabelStrV5(v2.KeyWord, v2.IsShowSubjectName)
|
|
|
- specialList[k2].ImgUrlBg = "https://hzstatic.hzinsights.com/static/temp/20220426202204/20220426/XDLLsjC9XAAy8LIzQr7GsjrBbtX6.png"
|
|
|
- }
|
|
|
+ condition += sqlExport + conditionOr
|
|
|
+ specialList, err := models.GetActivityLabelSpecialListAll(condition, pars, startSize, 8)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取失败"
|
|
|
+ br.ErrMsg = "获取失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ for k2, v2 := range specialList {
|
|
|
+ specialList[k2].KeyWord = services.LabelStrV5(v2.KeyWord, v2.IsShowSubjectName)
|
|
|
+ specialList[k2].ImgUrlBg = "https://hzstatic.hzinsights.com/static/temp/20220426202204/20220426/XDLLsjC9XAAy8LIzQr7GsjrBbtX6.png"
|
|
|
+ }
|
|
|
|
|
|
- itemList := new(models.ActivityTypeHome)
|
|
|
- itemList.ActivityTypeName = "专项产业调研"
|
|
|
- itemList.Resource = 2
|
|
|
- itemList.List = specialList
|
|
|
- itemList.ActivityTypeId = 7
|
|
|
- itemList.ImgUrl = "https://hzstatic.hzinsights.com/static/temp/20220427202204/20220427/b2Bj3fGakP16iJRFKisQohCWnCNl.png"
|
|
|
- itemList.ImgUrlBg = "https://hzstatic.hzinsights.com/static/temp/20220427202204/20220427/OkunjfKEgo5KRLifzwwLX8cDZnnN.png"
|
|
|
- list = append(list, itemList)
|
|
|
+ itemList := new(models.ActivityTypeHome)
|
|
|
+ itemList.ActivityTypeName = "专项产业调研"
|
|
|
+ itemList.Resource = 2
|
|
|
+ itemList.List = specialList
|
|
|
+ itemList.ActivityTypeId = 7
|
|
|
+ itemList.ImgUrl = "https://hzstatic.hzinsights.com/static/temp/20220427202204/20220427/b2Bj3fGakP16iJRFKisQohCWnCNl.png"
|
|
|
+ itemList.ImgUrlBg = "https://hzstatic.hzinsights.com/static/temp/20220427202204/20220427/OkunjfKEgo5KRLifzwwLX8cDZnnN.png"
|
|
|
+ list = append(list, itemList)
|
|
|
+ }
|
|
|
//获取对应活动的数量并排序
|
|
|
intArr := make([]int, 0)
|
|
|
var items []*models.ActivityTypeHome
|
|
@@ -4486,54 +4498,56 @@ func (this *ActivityCoAntroller) LabelTypeListV6Pc() {
|
|
|
list[k].Resource = 1
|
|
|
}
|
|
|
|
|
|
- //查询专项产业调研展示权限
|
|
|
- var condition string
|
|
|
- condition = ` AND art.publish_status = 1 AND art.label != '' `
|
|
|
- if isPower == 1 {
|
|
|
- condition += permissionSqlStr
|
|
|
- }
|
|
|
- //行业名称
|
|
|
- if len(chartPermissionIds) > 0 {
|
|
|
- condition += ` AND art.chart_permission_id IN (` + chartPermissionIds + `)`
|
|
|
- }
|
|
|
- var conditionOr string
|
|
|
+ if whichDay == "" {
|
|
|
+ //查询专项产业调研展示权限
|
|
|
+ var condition string
|
|
|
+ condition = ` AND art.publish_status = 1 AND art.label != '' `
|
|
|
+ if isPower == 1 {
|
|
|
+ condition += permissionSqlStr
|
|
|
+ }
|
|
|
+ //行业名称
|
|
|
+ if len(chartPermissionIds) > 0 {
|
|
|
+ condition += ` AND art.chart_permission_id IN (` + chartPermissionIds + `)`
|
|
|
+ }
|
|
|
+ var conditionOr string
|
|
|
|
|
|
- if (userType == 2 || userType == 3 || userType == 4) && strings.Contains(permissionStr, "专家") {
|
|
|
- conditionOr += ` OR (1=1 AND art.customer_type_ids LIKE '%4%' ` + condition + `) `
|
|
|
- }
|
|
|
- if (userType == 5) && strings.Contains(permissionStr, "专家") {
|
|
|
- conditionOr += ` OR (1=1 AND art.customer_type_ids LIKE '%5%' ` + condition + `) `
|
|
|
- }
|
|
|
- if userType == 1 {
|
|
|
- conditionOr += ` OR (1=1 ` + condition + permissionSqlStr + `) `
|
|
|
- }
|
|
|
+ if (userType == 2 || userType == 3 || userType == 4) && strings.Contains(permissionStr, "专家") {
|
|
|
+ conditionOr += ` OR (1=1 AND art.customer_type_ids LIKE '%4%' ` + condition + `) `
|
|
|
+ }
|
|
|
+ if (userType == 5) && strings.Contains(permissionStr, "专家") {
|
|
|
+ conditionOr += ` OR (1=1 AND art.customer_type_ids LIKE '%5%' ` + condition + `) `
|
|
|
+ }
|
|
|
+ if userType == 1 {
|
|
|
+ conditionOr += ` OR (1=1 ` + condition + permissionSqlStr + `) `
|
|
|
+ }
|
|
|
|
|
|
- if companyProduct != nil {
|
|
|
- if companyProduct.Scale != "" {
|
|
|
- conditionOr += ` OR ( art.scale LIKE '%` + companyProduct.Scale + `%' ` + condition + `) `
|
|
|
+ if companyProduct != nil {
|
|
|
+ if companyProduct.Scale != "" {
|
|
|
+ conditionOr += ` OR ( art.scale LIKE '%` + companyProduct.Scale + `%' ` + condition + `) `
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- condition += sqlExport + conditionOr
|
|
|
- specialList, err := models.GetActivityLabelSpecialListAll(condition, pars, startSize, 8)
|
|
|
- if err != nil {
|
|
|
- br.Msg = "获取失败"
|
|
|
- br.ErrMsg = "获取失败,Err:" + err.Error()
|
|
|
- return
|
|
|
- }
|
|
|
- for k2, v2 := range specialList {
|
|
|
- specialList[k2].KeyWord = services.LabelStrV5(v2.KeyWord, v2.IsShowSubjectName)
|
|
|
- specialList[k2].Resource = 2
|
|
|
- }
|
|
|
+ condition += sqlExport + conditionOr
|
|
|
+ specialList, err := models.GetActivityLabelSpecialListAll(condition, pars, startSize, 8)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取失败"
|
|
|
+ br.ErrMsg = "获取失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ for k2, v2 := range specialList {
|
|
|
+ specialList[k2].KeyWord = services.LabelStrV5(v2.KeyWord, v2.IsShowSubjectName)
|
|
|
+ specialList[k2].Resource = 2
|
|
|
+ }
|
|
|
|
|
|
- itemList := new(models.ActivityTypeHomePc)
|
|
|
- itemList.ActivityTypeName = "专项产业调研"
|
|
|
- itemList.Resource = 2
|
|
|
- itemList.List = specialList
|
|
|
- itemList.ActivityTypeId = 7
|
|
|
- itemList.OnlineIco = "https://hzstatic.hzinsights.com/static/temp/20220707202207/20220707/0H4md6VgZMuIttggMUnJxgrlayxC.png"
|
|
|
- itemList.ImgUrlBgPc = "https://hzstatic.hzinsights.com/static/temp/20220707202207/20220707/rFwAM1c4fIMJM0EGoUkUYl25XH9L.png"
|
|
|
- list = append(list, itemList)
|
|
|
+ itemList := new(models.ActivityTypeHomePc)
|
|
|
+ itemList.ActivityTypeName = "专项产业调研"
|
|
|
+ itemList.Resource = 2
|
|
|
+ itemList.List = specialList
|
|
|
+ itemList.ActivityTypeId = 7
|
|
|
+ itemList.OnlineIco = "https://hzstatic.hzinsights.com/static/temp/20220707202207/20220707/0H4md6VgZMuIttggMUnJxgrlayxC.png"
|
|
|
+ itemList.ImgUrlBgPc = "https://hzstatic.hzinsights.com/static/temp/20220707202207/20220707/rFwAM1c4fIMJM0EGoUkUYl25XH9L.png"
|
|
|
+ list = append(list, itemList)
|
|
|
+ }
|
|
|
//记录用户搜索的筛选条件
|
|
|
item := new(models.CygxActivitySearchHistory)
|
|
|
item.UserId = user.UserId
|