|
@@ -11,7 +11,7 @@ import (
|
|
"time"
|
|
"time"
|
|
)
|
|
)
|
|
|
|
|
|
-//修改标签状态
|
|
|
|
|
|
+// 修改标签状态
|
|
func UpdateIndustrialManagementLabel(cont context.Context) (err error) {
|
|
func UpdateIndustrialManagementLabel(cont context.Context) (err error) {
|
|
defer func() {
|
|
defer func() {
|
|
if err != nil {
|
|
if err != nil {
|
|
@@ -41,7 +41,7 @@ func UpdateIndustrialManagementLabel(cont context.Context) (err error) {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
|
|
-//修改活动状态
|
|
|
|
|
|
+// 修改活动状态
|
|
func UpdateIndustrialManagementSubjectNnames() (err error) {
|
|
func UpdateIndustrialManagementSubjectNnames() (err error) {
|
|
defer func() {
|
|
defer func() {
|
|
if err != nil {
|
|
if err != nil {
|
|
@@ -108,7 +108,7 @@ func ReportBillboardUpdate(cont context.Context) (err error) {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
|
|
-//修改产业关注数量
|
|
|
|
|
|
+// 修改产业关注数量
|
|
func IndustryFllowCountUpdate() (err error) {
|
|
func IndustryFllowCountUpdate() (err error) {
|
|
defer func() {
|
|
defer func() {
|
|
if err != nil {
|
|
if err != nil {
|
|
@@ -129,7 +129,7 @@ func IndustryFllowCountUpdate() (err error) {
|
|
return err
|
|
return err
|
|
}
|
|
}
|
|
|
|
|
|
-//修改文章收藏数量
|
|
|
|
|
|
+// 修改文章收藏数量
|
|
func ArticleCollectCountUpdate() (err error) {
|
|
func ArticleCollectCountUpdate() (err error) {
|
|
defer func() {
|
|
defer func() {
|
|
if err != nil {
|
|
if err != nil {
|
|
@@ -150,7 +150,7 @@ func ArticleCollectCountUpdate() (err error) {
|
|
return err
|
|
return err
|
|
}
|
|
}
|
|
|
|
|
|
-//根据行业处理所选的全部赛道字段
|
|
|
|
|
|
+// 根据行业处理所选的全部赛道字段
|
|
func DoXzsChooseSend(chartPermissionName string) string {
|
|
func DoXzsChooseSend(chartPermissionName string) string {
|
|
var allIn string
|
|
var allIn string
|
|
if chartPermissionName == utils.YI_YAO_NAME {
|
|
if chartPermissionName == utils.YI_YAO_NAME {
|
|
@@ -167,7 +167,7 @@ func DoXzsChooseSend(chartPermissionName string) string {
|
|
return allIn
|
|
return allIn
|
|
}
|
|
}
|
|
|
|
|
|
-//行业关注或者取消关注的时候,对于用户全部赛道的影响
|
|
|
|
|
|
+// 行业关注或者取消关注的时候,对于用户全部赛道的影响
|
|
func IndustryFllowWithTrack(industrialManagementId, count, uid int) (err error) {
|
|
func IndustryFllowWithTrack(industrialManagementId, count, uid int) (err error) {
|
|
defer func() {
|
|
defer func() {
|
|
if err != nil {
|
|
if err != nil {
|
|
@@ -272,7 +272,7 @@ func GetIndustryNewLabelMap(industryIds []int) (labelMap map[int]bool, err error
|
|
// GetIndustrialManagementArticleNewPublishData()
|
|
// GetIndustrialManagementArticleNewPublishData()
|
|
//}
|
|
//}
|
|
|
|
|
|
-//批量修改获取产业关联文章的最新发布时间
|
|
|
|
|
|
+// 批量修改获取产业关联文章的最新发布时间
|
|
func GetIndustrialManagementArticleNewPublishData() (err error) {
|
|
func GetIndustrialManagementArticleNewPublishData() (err error) {
|
|
defer func() {
|
|
defer func() {
|
|
if err != nil {
|
|
if err != nil {
|
|
@@ -309,7 +309,7 @@ func GetIndustrialManagementArticleNewPublishData() (err error) {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
|
|
-//HandleIndustryList预处理产业列表字段
|
|
|
|
|
|
+// HandleIndustryList预处理产业列表字段
|
|
func HandleIndustryList(list []*models.IndustrialManagement, user *models.WxUserItem) (items []*models.IndustrialManagement, err error) {
|
|
func HandleIndustryList(list []*models.IndustrialManagement, user *models.WxUserItem) (items []*models.IndustrialManagement, err error) {
|
|
userId := user.UserId
|
|
userId := user.UserId
|
|
fllowList, err := models.GetUserFllowIndustrialList(userId)
|
|
fllowList, err := models.GetUserFllowIndustrialList(userId)
|
|
@@ -432,11 +432,11 @@ func HandleIndustryList(list []*models.IndustrialManagement, user *models.WxUser
|
|
industrialIdMap := make(map[string]time.Time)
|
|
industrialIdMap := make(map[string]time.Time)
|
|
for _, v := range recrodList {
|
|
for _, v := range recrodList {
|
|
industrialManagementIdstr = strings.TrimLeft(v.Parameter, "PageSize=10&CurrentIndex=1&CategoryId=99999&IndustrialManagementId=")
|
|
industrialManagementIdstr = strings.TrimLeft(v.Parameter, "PageSize=10&CurrentIndex=1&CategoryId=99999&IndustrialManagementId=")
|
|
- if createTime, ok := industrialIdMap[industrialManagementIdstr]; ok{
|
|
|
|
|
|
+ if createTime, ok := industrialIdMap[industrialManagementIdstr]; ok {
|
|
if createTime.Before(v.CreateTime) {
|
|
if createTime.Before(v.CreateTime) {
|
|
industrialIdMap[industrialManagementIdstr] = v.CreateTime
|
|
industrialIdMap[industrialManagementIdstr] = v.CreateTime
|
|
}
|
|
}
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
industrialIdMap[industrialManagementIdstr] = v.CreateTime
|
|
industrialIdMap[industrialManagementIdstr] = v.CreateTime
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -452,7 +452,7 @@ func HandleIndustryList(list []*models.IndustrialManagement, user *models.WxUser
|
|
timeLineRedMap := make(map[int]bool, 0)
|
|
timeLineRedMap := make(map[int]bool, 0)
|
|
|
|
|
|
for _, industrialId := range industrialIdArr {
|
|
for _, industrialId := range industrialIdArr {
|
|
- if createTime, ok := industrialIdMap[strconv.Itoa(industrialId)]; ok{
|
|
|
|
|
|
+ if createTime, ok := industrialIdMap[strconv.Itoa(industrialId)]; ok {
|
|
if createTime.Before(morningMeetingTimeMap[industrialId]) {
|
|
if createTime.Before(morningMeetingTimeMap[industrialId]) {
|
|
timeLineRedMap[industrialId] = true
|
|
timeLineRedMap[industrialId] = true
|
|
}
|
|
}
|
|
@@ -505,3 +505,37 @@ func HandleIndustryList(list []*models.IndustrialManagement, user *models.WxUser
|
|
items = list
|
|
items = list
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+// 通过文章ID获取文章所关联的产业
|
|
|
|
+//func GetArticleIndustrialByArticleId() {
|
|
|
|
+// var condition string
|
|
|
|
+// var pars []interface{}
|
|
|
|
+// pars = make([]interface{}, 0)
|
|
|
|
+// condition = ` AND a.article_id IN (` + utils.GetOrmInReplace(len(articleIds)) + `)`
|
|
|
|
+// pars = append(pars, articleIds)
|
|
|
|
+// articleIds = strings.TrimRight(articleIds, ",")
|
|
|
|
+// silcearticleIds := strings.Split(articleIds, ",")
|
|
|
|
+// var parsindustrial []interface{}
|
|
|
|
+// parsindustrial = make([]interface{}, 0)
|
|
|
|
+// articleIdList := make([]string, 0)
|
|
|
|
+// for _, v := range silcearticleIds {
|
|
|
|
+// articleIdList = append(articleIdList, v)
|
|
|
|
+// }
|
|
|
|
+// conditionindustrial := ` AND mg.article_id IN ( ` + utils.GetOrmInReplace(len(silcearticleIds)) + ` ) `
|
|
|
|
+// parsindustrial = append(parsindustrial, articleIdList)
|
|
|
|
+// industrialList, err := models.GetIndustrialListByarticleId(parsindustrial, conditionindustrial)
|
|
|
|
+// if err != nil {
|
|
|
|
+// return
|
|
|
|
+// }
|
|
|
|
+// industrialMap := make(map[int][]*models.IndustrialManagementResp)
|
|
|
|
+// if len(industrialList) > 0 {
|
|
|
|
+// for _, v := range industrialList {
|
|
|
|
+// item := new(models.IndustrialManagementResp)
|
|
|
|
+// //item.ArticleId = v.ArticleId
|
|
|
|
+// item.IndustrialManagementId = v.IndustrialManagementId
|
|
|
|
+// item.IndustryName = v.IndustryName
|
|
|
|
+// item.ChartPermissionId = v.ChartPermissionId
|
|
|
|
+// industrialMap[v.ArticleId] = append(industrialMap[v.ArticleId], item)
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+//}
|