|
@@ -12,7 +12,6 @@ import (
|
|
|
"strconv"
|
|
|
"strings"
|
|
|
"time"
|
|
|
- "unicode/utf8"
|
|
|
)
|
|
|
|
|
|
// 活动
|
|
@@ -2560,7 +2559,7 @@ func (this *ActivityCoAntroller) LabelTypeListV5() {
|
|
|
return
|
|
|
}
|
|
|
var startSize int
|
|
|
- pageSize = 20
|
|
|
+ pageSize = 1000
|
|
|
var sortTime string
|
|
|
var pars []interface{}
|
|
|
//活动可见限制
|
|
@@ -2588,6 +2587,45 @@ func (this *ActivityCoAntroller) LabelTypeListV5() {
|
|
|
permissionNameStr += `, '宏观'`
|
|
|
}
|
|
|
|
|
|
+ var condition string
|
|
|
+ conditionActivity, err := services.GetActivityonditionList(user, "", chartPermissionIds, whichDay, activeState, "", isPower, 0, "", 0, 1)
|
|
|
+ if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ br.Msg = "获取失败"
|
|
|
+ br.ErrMsg = "获取活动权限数据失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ condition += `AND art.is_limit_people = 1 ` + conditionActivity
|
|
|
+ sortTime = ` mintimesort ASC `
|
|
|
+ listActivity, err := models.GetActivityLabelListAll(condition, sortTime, pars, startSize, pageSize)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取失败"
|
|
|
+ br.ErrMsg = "获取失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ mapActivity := make(map[int][]*models.CygxActivityLabelList)
|
|
|
+ mapkeyWord := make(map[string]string)
|
|
|
+ for _, v := range listActivity {
|
|
|
+ if v.KeyWord == "" {
|
|
|
+ continue
|
|
|
+ }
|
|
|
+ // 如果是C类电话会就不展示内容,且合并到分析师电话会
|
|
|
+ if v.ActivityTypeId == 7 {
|
|
|
+ v.ActivityTypeId = 2
|
|
|
+ }
|
|
|
+ item := new(models.CygxActivityLabelList)
|
|
|
+ item.KeyWord = services.LabelStrV5(v.KeyWord, v.IsShowSubjectName, v.TemporaryLabel)
|
|
|
+ if _, ok := mapkeyWord[fmt.Sprint(v.ActivityTypeId, "-", item.KeyWord)]; ok {
|
|
|
+ continue
|
|
|
+ }
|
|
|
+ item.Resource = 1
|
|
|
+ item.ActivityId = v.ActivityId
|
|
|
+ if v.YidongActivityId > 0 {
|
|
|
+ item.IsExternalLabel = true
|
|
|
+ }
|
|
|
+ mapActivity[v.ActivityTypeId] = append(mapActivity[v.ActivityTypeId], item)
|
|
|
+ mapkeyWord[fmt.Sprint(v.ActivityTypeId, "-", item.KeyWord)] = item.KeyWord
|
|
|
+ }
|
|
|
+ //
|
|
|
list, err := models.GetActivityTypeHomeList()
|
|
|
if err != nil {
|
|
|
br.Msg = "获取失败"
|
|
@@ -2607,44 +2645,55 @@ func (this *ActivityCoAntroller) LabelTypeListV5() {
|
|
|
resp := new(models.ActivityTypeListHomeResp)
|
|
|
for k, v := range list {
|
|
|
// 如果是C类电话会就不展示内容,且合并到分析师电话会
|
|
|
- if v.ActivityTypeId == utils.C_CLASS_ACTIVITY_TYPE_ID {
|
|
|
- continue
|
|
|
- }
|
|
|
- var condition string
|
|
|
- conditionActivity, err := services.GetActivityonditionList(user, strconv.Itoa(v.ActivityTypeId), chartPermissionIds, whichDay, activeState, "", isPower, 0, "", 0, 1)
|
|
|
- if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
- br.Msg = "获取失败"
|
|
|
- br.ErrMsg = "获取活动权限数据失败,Err:" + err.Error()
|
|
|
- return
|
|
|
- }
|
|
|
- condition += `AND art.is_limit_people = 1 ` + conditionActivity
|
|
|
- sortTime = ` mintimesort ASC `
|
|
|
- labelList, err := models.GetActivityLabelListAll(condition, sortTime, pars, startSize, pageSize)
|
|
|
- if err != nil {
|
|
|
- br.Msg = "获取失败"
|
|
|
- br.ErrMsg = "获取失败,Err:" + err.Error()
|
|
|
- return
|
|
|
- }
|
|
|
- var itemslabe []*models.CygxActivityLabelList
|
|
|
+ //if v.ActivityTypeId == utils.C_CLASS_ACTIVITY_TYPE_ID {
|
|
|
+ // continue
|
|
|
+ //}
|
|
|
+ //var condition string
|
|
|
+ //conditionActivity, err := services.GetActivityonditionList(user, "", chartPermissionIds, whichDay, activeState, "", isPower, 0, "", 0, 1)
|
|
|
+ //if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ // br.Msg = "获取失败"
|
|
|
+ // br.ErrMsg = "获取活动权限数据失败,Err:" + err.Error()
|
|
|
+ // return
|
|
|
+ //}
|
|
|
+ //condition += `AND art.is_limit_people = 1 ` + conditionActivity
|
|
|
+ //sortTime = ` mintimesort ASC `
|
|
|
+ //labelList, err := models.GetActivityLabelListAll(condition, sortTime, pars, startSize, pageSize)
|
|
|
+ //if err != nil {
|
|
|
+ // br.Msg = "获取失败"
|
|
|
+ // br.ErrMsg = "获取失败,Err:" + err.Error()
|
|
|
+ // return
|
|
|
+ //}
|
|
|
+ //var itemslabe []*models.CygxActivityLabelList
|
|
|
|
|
|
- mapkeyWord := make(map[string]string)
|
|
|
+ //mapkeyWord := make(map[string]string)
|
|
|
//标签字段关联的产业与标签处理
|
|
|
- for k2, v2 := range labelList {
|
|
|
- if v2.YidongActivityId != 0 {
|
|
|
- v2.IsExternalLabel = true
|
|
|
- }
|
|
|
- if utf8.RuneCountInString(v2.City) != 2 {
|
|
|
- labelList[k2].City = ""
|
|
|
- }
|
|
|
- labelList[k2].KeyWord = services.LabelStrV5(v2.KeyWord, v2.IsShowSubjectName, v2.TemporaryLabel)
|
|
|
- labelList[k2].ImgUrlBg = v.ImgUrlBgs
|
|
|
- if _, ok := mapkeyWord[fmt.Sprint(v.ActivityTypeId, "-", labelList[k2].KeyWord)]; ok {
|
|
|
- continue
|
|
|
+ //for k2, v2 := range labelList {
|
|
|
+ // if v2.YidongActivityId != 0 {
|
|
|
+ // v2.IsExternalLabel = true
|
|
|
+ // }
|
|
|
+ // if v2.ActivityTypeId == 7 {
|
|
|
+ // v2.ActivityTypeId = 2
|
|
|
+ // }
|
|
|
+ // if v.ActivityTypeId == 7 {
|
|
|
+ // v.ActivityTypeId = 2
|
|
|
+ // }
|
|
|
+ // if utf8.RuneCountInString(v2.City) != 2 {
|
|
|
+ // labelList[k2].City = ""
|
|
|
+ // }
|
|
|
+ // labelList[k2].KeyWord = services.LabelStrV5(v2.KeyWord, v2.IsShowSubjectName, v2.TemporaryLabel)
|
|
|
+ // labelList[k2].ImgUrlBg = v.ImgUrlBgs
|
|
|
+ // if _, ok := mapkeyWord[fmt.Sprint(v.ActivityTypeId, "-", labelList[k2].KeyWord)]; ok {
|
|
|
+ // continue
|
|
|
+ // }
|
|
|
+ // itemslabe = append(itemslabe, labelList[k2])
|
|
|
+ // mapkeyWord[fmt.Sprint(v.ActivityTypeId, "-", labelList[k2].KeyWord)] = labelList[k2].KeyWord
|
|
|
+ //}
|
|
|
+ if len(mapActivity[v.ActivityTypeId]) > 0 {
|
|
|
+ for _, v2 := range mapActivity[v.ActivityTypeId] {
|
|
|
+ v2.ImgUrlBg = v.ImgUrlBgs
|
|
|
}
|
|
|
- itemslabe = append(itemslabe, labelList[k2])
|
|
|
- mapkeyWord[fmt.Sprint(v.ActivityTypeId, "-", labelList[k2].KeyWord)] = labelList[k2].KeyWord
|
|
|
}
|
|
|
- list[k].List = itemslabe
|
|
|
+ list[k].List = mapActivity[v.ActivityTypeId]
|
|
|
list[k].Resource = 1
|
|
|
}
|
|
|
|
|
@@ -2773,7 +2822,7 @@ func (this *ActivityCoAntroller) LabelTypeListV5() {
|
|
|
// @Param PageSize query int true "每页数据条数"
|
|
|
// @Param CurrentIndex query int true "当前页页码,从1开始"
|
|
|
// @Success 200 {object} models.GetCygxActivitySpecialDetailListResp
|
|
|
-// @router /special/list [get]
|
|
|
+// @router /special/del_list [get]
|
|
|
func (this *ActivityCoAntroller) SpecialList() {
|
|
|
br := new(models.BaseResponse).Init()
|
|
|
defer func() {
|