zhangchuanxing 4 сар өмнө
parent
commit
a997a40d5b

+ 3 - 0
controllers/report.go

@@ -2260,6 +2260,8 @@ func (this *MobileReportController) ZouqiTradeList() {
 		return
 	}
 
+	fllowMap := services.GetXzsChooseCategoryZhouqiMapByMobile(user.Mobile)
+
 	resp := new(models.TradeReportMappingResp)
 	var list []*models.TradeReportMapping
 	if len(listCategory) == 0 {
@@ -2270,6 +2272,7 @@ func (this *MobileReportController) ZouqiTradeList() {
 			item.CategoryId = v.CategoryId
 			item.MatchTypeName = v.MatchTypeName
 			item.UpdateTime = v.ArticleUpdateTime
+			item.IsFollow = fllowMap[item.CategoryId]
 			item.ListArticle = make([]*models.HomeArticle, 0)
 			list = append(list, item)
 		}

+ 33 - 0
services/ficc_report.go

@@ -0,0 +1,33 @@
+package services
+
+import (
+	"errors"
+	"fmt"
+	"hongze/hongze_clpt/models"
+	"hongze/hongze_clpt/utils"
+)
+
+// GetXzsChooseCategoryZhouqiMapByMobile 根据手机号获取周期分类的关注信息
+func GetXzsChooseCategoryZhouqiMapByMobile(mobile string) (mapResp map[int]bool) {
+	if mobile == "" {
+		return
+	}
+	var err error
+	defer func() {
+		if err != nil {
+			fmt.Println("err:", err)
+			go utils.SendAlarmMsg(fmt.Sprint("更新周期对应分类下所管理文章的更新时间 失败,GetXzsChooseCategoryZhouqiMapByMobile Err:"+err.Error()+"mobile", mobile), 3)
+		}
+	}()
+
+	listFollw, e := models.GetCygxXzsChooseCategoryZhouqiList(mobile)
+	if e != nil {
+		err = errors.New("GetCygxZhouqiArticleMapByParentId, Err: " + err.Error())
+		return
+	}
+	mapResp = make(map[int]bool, 0)
+	for _, v := range listFollw {
+		mapResp[v.CategoryId] = true
+	}
+	return
+}