Explorar o código

feat:我的菜单更新

wangshan %!s(int64=2) %!d(string=hai) anos
pai
achega
e838a16964

+ 0 - 1
api/internal/logic/workdesktopmenuinfologic.go

@@ -47,7 +47,6 @@ func (l *WorkDesktopMenuInfoLogic) WorkDesktopMenuInfo(req *types.WorkDesktopMen
 		PositionType: req.PositionType,
 		MgoUserId:    req.MgoUserId,
 	})
-	logx.Info("-----------------------:", req.MgoUserId)
 	return &types.CommonResp{
 		Error_code: res.ErrorCode,
 		Error_msg:  res.ErrorMsg,

+ 9 - 0
entity/user.go

@@ -208,6 +208,15 @@ func (m *WorkDesktopMenu) AutoUserPowerInfo() map[string]int {
 			UserPowerMap[plv] = 1
 		}
 	}
+	//其他权益数据库查询
+	func(mgoUserId string) {
+		//伙伴计划是否加入(移动端我的伙伴计划菜单)
+		if count := Mysql.CountBySql(`select count(*) from dis_partner where uid=? and type!=3`, mgoUserId); count > 0 {
+			UserPowerMap["801"] = 1
+		} else {
+			UserPowerMap["800"] = 1
+		}
+	}(m.MgoUserId)
 	//缓存
 	if UserPowerMap != nil {
 		bytes, err := json.Marshal(UserPowerMap)

+ 1 - 2
entity/workDesktop.go

@@ -261,8 +261,7 @@ func (m *WorkDesktopMenu) WorkMenuFormat() ([]*pb.MenuList, error) {
 								AppType:      appType,
 								OpenType:     openType,
 							},
-							Match:     MC.If(tv.Match != "", strings.Split(tv.Match, ","), []string{}).([]string),
-							GroupName: strings.Replace(strconv.Itoa(tv.OrderId), "0", "-", -1),
+							Match: MC.If(tv.Match != "", strings.Split(tv.Match, ","), []string{}).([]string),
 						}
 						if len(tv.Children) > 0 {
 						L:

+ 1 - 1
go.mod

@@ -1,6 +1,6 @@
 module bp.jydev.jianyu360.cn/BaseService/userCenter
 
-go 1.20
+go 1.18
 
 require (
 	app.yhyue.com/moapp/jyInfo v1.0.0

+ 1 - 1
service/workDesktop.go

@@ -249,7 +249,7 @@ func GetWordDesktopMenuTree(in *WorkDesktopMenuInfoReq) ([]*pb.MenuList, error)
 	RedisMenuKey := fmt.Sprintf(entity.RedisMenuKey, in.AppId, entity.ConfigJson.MenuCacheKey, in.UserId)
 	logx.Info("RedisMenuKey:", RedisMenuKey)
 	menuBytes, err := redis.GetBytes(entity.RedisCode, RedisMenuKey)
-	if false && in.WorkStatus == 0 && err == nil && len(*menuBytes) > 0 {
+	if in.WorkStatus == 0 && err == nil && len(*menuBytes) > 0 {
 		if json.Unmarshal(*menuBytes, &menuList) == nil {
 			return menuList, nil
 		}