فهرست منبع

feat:首页采购单位画像 权限调整

wangshan 2 سال پیش
والد
کامیت
96e03cf783
2فایلهای تغییر یافته به همراه11 افزوده شده و 5 حذف شده
  1. 5 4
      src/jfw/front/classificationTag.go
  2. 6 1
      src/jfw/front/pcIndex.go

+ 5 - 4
src/jfw/front/classificationTag.go

@@ -269,11 +269,11 @@ func GetIndustry(industryHref string) []map[string]interface{} {
 
 type BuyerList struct {
 	Name string `json:"name"`
-	Id   string `json:"id"`
+	Url  string `json:"url"`
 }
 
 // 热门采购单位
-func HotBuyerList() []*BuyerList {
+func HotBuyerList(entIsNew bool) []*BuyerList {
 	// 使用当前时间作为随机数生成器的种子
 	randGen := rand.New(rand.NewSource(time.Now().UnixNano()))
 	// 获取一个范围在 [0, 100) 的随机整数
@@ -284,9 +284,10 @@ func HotBuyerList() []*BuyerList {
 	if len(*data) > 0 {
 		var buyerList []*BuyerList
 		for _, b := range *data {
+			name := qu.ObjToString(b["name"])
 			buyerList = append(buyerList, &BuyerList{
-				Name: qu.ObjToString(b["name"]),
-				Id:   encrypt.EncodeArticleId2ByCheck(qu.ObjToString(b["_id"])),
+				Name: name,
+				Url:  qu.If(entIsNew, fmt.Sprintf("/entpc/unit_portrayal/%s", name), fmt.Sprintf("/swordfish/page_big_pc/unit_portrayal/%s", name)).(string),
 			})
 		}
 		return buyerList

+ 6 - 1
src/jfw/front/pcIndex.go

@@ -97,6 +97,11 @@ func (m *PcIndex) NewSordfish(flag string) error {
 		} else if flag == "tmp" {
 			return m.Render("/pc/index_tmp.html", &m.T)
 		} else {
+			var entIsNew bool
+			if m.GetSession("userId") != "" {
+				bigBaseMsg := jy.GetBigVipUserBaseMsg(m.Session(), *config.Middleground)
+				entIsNew = bigBaseMsg.EntIsNew
+			}
 			//按地区、信息类型、热门招标
 			for k, v := range RegionAndInformationAndTender() {
 				m.T[k] = v
@@ -108,7 +113,7 @@ func (m *PcIndex) NewSordfish(flag string) error {
 			//推荐标讯专区
 			m.T["recommendBeacon"] = RecommendationBeacon()
 			//热门采购单位
-			m.T["hotBuyers"] = HotBuyerList()
+			m.T["hotBuyers"] = HotBuyerList(entIsNew)
 			m.T["hasLogin"] = m.GetSession("userId") != ""
 			return m.Render("/pc/index.html", &m.T)
 		}