|
@@ -11,7 +11,7 @@ import (
|
|
|
"time"
|
|
|
)
|
|
|
|
|
|
-//修改标签状态
|
|
|
+// 修改标签状态
|
|
|
func UpdateIndustrialManagementLabel(cont context.Context) (err error) {
|
|
|
defer func() {
|
|
|
if err != nil {
|
|
@@ -41,7 +41,7 @@ func UpdateIndustrialManagementLabel(cont context.Context) (err error) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//修改活动状态
|
|
|
+// 修改活动状态
|
|
|
func UpdateIndustrialManagementSubjectNnames() (err error) {
|
|
|
defer func() {
|
|
|
if err != nil {
|
|
@@ -108,7 +108,7 @@ func ReportBillboardUpdate(cont context.Context) (err error) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//修改产业关注数量
|
|
|
+// 修改产业关注数量
|
|
|
func IndustryFllowCountUpdate() (err error) {
|
|
|
defer func() {
|
|
|
if err != nil {
|
|
@@ -129,7 +129,7 @@ func IndustryFllowCountUpdate() (err error) {
|
|
|
return err
|
|
|
}
|
|
|
|
|
|
-//修改文章收藏数量
|
|
|
+// 修改文章收藏数量
|
|
|
func ArticleCollectCountUpdate() (err error) {
|
|
|
defer func() {
|
|
|
if err != nil {
|
|
@@ -150,7 +150,7 @@ func ArticleCollectCountUpdate() (err error) {
|
|
|
return err
|
|
|
}
|
|
|
|
|
|
-//根据行业处理所选的全部赛道字段
|
|
|
+// 根据行业处理所选的全部赛道字段
|
|
|
func DoXzsChooseSend(chartPermissionName string) string {
|
|
|
var allIn string
|
|
|
if chartPermissionName == utils.YI_YAO_NAME {
|
|
@@ -167,7 +167,7 @@ func DoXzsChooseSend(chartPermissionName string) string {
|
|
|
return allIn
|
|
|
}
|
|
|
|
|
|
-//行业关注或者取消关注的时候,对于用户全部赛道的影响
|
|
|
+// 行业关注或者取消关注的时候,对于用户全部赛道的影响
|
|
|
func IndustryFllowWithTrack(industrialManagementId, count, uid int) (err error) {
|
|
|
defer func() {
|
|
|
if err != nil {
|
|
@@ -272,7 +272,7 @@ func GetIndustryNewLabelMap(industryIds []int) (labelMap map[int]bool, err error
|
|
|
// GetIndustrialManagementArticleNewPublishData()
|
|
|
//}
|
|
|
|
|
|
-//批量修改获取产业关联文章的最新发布时间
|
|
|
+// 批量修改获取产业关联文章的最新发布时间
|
|
|
func GetIndustrialManagementArticleNewPublishData() (err error) {
|
|
|
defer func() {
|
|
|
if err != nil {
|
|
@@ -309,7 +309,7 @@ func GetIndustrialManagementArticleNewPublishData() (err error) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//HandleIndustryList预处理产业列表字段
|
|
|
+// HandleIndustryList预处理产业列表字段
|
|
|
func HandleIndustryList(list []*models.IndustrialManagement, user *models.WxUserItem) (items []*models.IndustrialManagement, err error) {
|
|
|
userId := user.UserId
|
|
|
fllowList, err := models.GetUserFllowIndustrialList(userId)
|
|
@@ -432,11 +432,11 @@ func HandleIndustryList(list []*models.IndustrialManagement, user *models.WxUser
|
|
|
industrialIdMap := make(map[string]time.Time)
|
|
|
for _, v := range recrodList {
|
|
|
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) {
|
|
|
industrialIdMap[industrialManagementIdstr] = v.CreateTime
|
|
|
}
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
industrialIdMap[industrialManagementIdstr] = v.CreateTime
|
|
|
}
|
|
|
}
|
|
@@ -452,7 +452,7 @@ func HandleIndustryList(list []*models.IndustrialManagement, user *models.WxUser
|
|
|
timeLineRedMap := make(map[int]bool, 0)
|
|
|
|
|
|
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]) {
|
|
|
timeLineRedMap[industrialId] = true
|
|
|
}
|
|
@@ -505,3 +505,19 @@ func HandleIndustryList(list []*models.IndustrialManagement, user *models.WxUser
|
|
|
items = list
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
+// GetIndustryUserFollowMap 获取用户关注的产业
|
|
|
+func GetIndustryUserFollowMap(user *models.WxUserItem) (itemMap map[int]bool, err error) {
|
|
|
+ condition := ` AND user_id = ` + strconv.Itoa(user.UserId)
|
|
|
+ listIndustryFllow, e := models.GetCygxIndustryFllowList(condition)
|
|
|
+ if e != nil {
|
|
|
+ err = errors.New("GetCygxIndustryFllowList " + e.Error())
|
|
|
+ return
|
|
|
+ }
|
|
|
+ follwMap := make(map[int]bool)
|
|
|
+ for _, v := range listIndustryFllow {
|
|
|
+ follwMap[v.IndustrialManagementId] = true
|
|
|
+ }
|
|
|
+ itemMap = follwMap
|
|
|
+ return
|
|
|
+}
|