|
@@ -5,7 +5,6 @@ import (
|
|
"app.yhyue.com/moapp/jybase/redis"
|
|
"app.yhyue.com/moapp/jybase/redis"
|
|
"context"
|
|
"context"
|
|
IC "jyBXSubscribe/rpc/init"
|
|
IC "jyBXSubscribe/rpc/init"
|
|
- "jyBXSubscribe/rpc/model"
|
|
|
|
"strconv"
|
|
"strconv"
|
|
"time"
|
|
"time"
|
|
|
|
|
|
@@ -45,29 +44,29 @@ func (l *GetSubSomeInfoLogic) GetSubSomeInfo(in *bxsubscribe.SomeInfoReq) (*bxsu
|
|
},
|
|
},
|
|
}
|
|
}
|
|
baseUserId, _ := strconv.ParseInt(in.NewUserId, 10, 64)
|
|
baseUserId, _ := strconv.ParseInt(in.NewUserId, 10, 64)
|
|
- //accountId, _ := strconv.ParseInt(in.AccountId, 10, 64)
|
|
|
|
- //positionType, _ := strconv.ParseInt(in.PositionType, 10, 64)
|
|
|
|
- //positionId, _ := strconv.ParseInt(in.PositionId, 10, 64)
|
|
|
|
- //entId, _ := strconv.ParseInt(in.EntId, 10, 64)
|
|
|
|
- //userInfo := IC.Compatible.Middleground.PowerCheckCenter.Check(in.AppId, in.UserId, baseUserId, accountId, entId, positionType, positionId)
|
|
|
|
|
|
+ accountId, _ := strconv.ParseInt(in.AccountId, 10, 64)
|
|
|
|
+ positionType, _ := strconv.ParseInt(in.PositionType, 10, 64)
|
|
|
|
+ positionId, _ := strconv.ParseInt(in.PositionId, 10, 64)
|
|
|
|
+ entId, _ := strconv.ParseInt(in.EntId, 10, 64)
|
|
|
|
+ user := IC.Compatible.Middleground.PowerCheckCenter.Check(in.AppId, in.UserId, baseUserId, accountId, entId, positionType, positionId)
|
|
//logx.Info("userInfo:", userInfo)
|
|
//logx.Info("userInfo:", userInfo)
|
|
//P278 身份切换,切换企业 userId从代理header 获取的值是 职位id,所以改成用base_user_id 进行查user表信息
|
|
//P278 身份切换,切换企业 userId从代理header 获取的值是 职位id,所以改成用base_user_id 进行查user表信息
|
|
- user, _ := model.NewSubscribePush(in.UserType).UserInfo(baseUserId)
|
|
|
|
|
|
+ //user, _ := model.NewSubscribePush(in.UserType).UserInfo(in.UserId)
|
|
//
|
|
//
|
|
- resp.Data.HasKey, resp.Data.Industry = model.GetKeySet(in.UserType, user, []string{})
|
|
|
|
|
|
+ //resp.Data.HasKey, resp.Data.Industry = model.GetKeySet(in.UserType, user, []string{})
|
|
todayNum := time.Unix(time.Now().Unix(), 1).Format("20060102")
|
|
todayNum := time.Unix(time.Now().Unix(), 1).Format("20060102")
|
|
if user != nil {
|
|
if user != nil {
|
|
//超级订阅
|
|
//超级订阅
|
|
- if common.IntAll((*user)["i_vip_status"]) == 1 || common.IntAll((*user)["i_vip_status"]) == 2 {
|
|
|
|
|
|
+ if user.Vip.Status == 1 || common.IntAll((*user)["i_vip_status"]) == 2 {
|
|
var threeRemind = int64(3 * 24 * 60 * 60)
|
|
var threeRemind = int64(3 * 24 * 60 * 60)
|
|
var twoRemind = int64(2 * 24 * 60 * 60)
|
|
var twoRemind = int64(2 * 24 * 60 * 60)
|
|
var oneRemind = int64(1 * 24 * 60 * 60)
|
|
var oneRemind = int64(1 * 24 * 60 * 60)
|
|
- if (*user)["isread"] != nil {
|
|
|
|
|
|
+ /*if (*user)["isread"] != nil {
|
|
resp.Data.IsRead = (*user)["isread"].(bool)
|
|
resp.Data.IsRead = (*user)["isread"].(bool)
|
|
- }
|
|
|
|
|
|
+ }*/
|
|
resp.Data.IsPassCount = redis.GetInt("pushcache_2_a", "oncecount_"+todayNum+"_"+in.UserId) >= 2000
|
|
resp.Data.IsPassCount = redis.GetInt("pushcache_2_a", "oncecount_"+todayNum+"_"+in.UserId) >= 2000
|
|
- resp.Data.IsOnTail = common.Int64All((*user)["i_vip_status"])
|
|
|
|
- _endtime := (*user)["l_vip_endtime"]
|
|
|
|
|
|
+ resp.Data.IsOnTail = user.Vip.Status
|
|
|
|
+ _endtime := user.Vip.EndTime
|
|
//是否到期
|
|
//是否到期
|
|
if common.Int64All(_endtime)-time.Now().Unix() < threeRemind && common.Int64All(_endtime)-time.Now().Unix() >= twoRemind {
|
|
if common.Int64All(_endtime)-time.Now().Unix() < threeRemind && common.Int64All(_endtime)-time.Now().Unix() >= twoRemind {
|
|
resp.Data.IsExpire = 3 //即将到期
|
|
resp.Data.IsExpire = 3 //即将到期
|
|
@@ -85,22 +84,20 @@ func (l *GetSubSomeInfoLogic) GetSubSomeInfo(in *bxsubscribe.SomeInfoReq) (*bxsu
|
|
resp.Data.OtherFlag = true
|
|
resp.Data.OtherFlag = true
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
- if (*user)["i_vip_status"] == nil {
|
|
|
|
|
|
+ if user.Vip.Status <= 0 {
|
|
resp.Data.IsExpire = 0
|
|
resp.Data.IsExpire = 0
|
|
} else {
|
|
} else {
|
|
- resp.Data.IsOnTail = common.Int64All((*user)["i_vip_status"])
|
|
|
|
|
|
+ resp.Data.IsOnTail = user.Vip.Status
|
|
}
|
|
}
|
|
resp.Data.IsPassCount = redis.GetInt("pushcache_2_a", "oncecount_"+todayNum+"_"+in.UserId) >= 150
|
|
resp.Data.IsPassCount = redis.GetInt("pushcache_2_a", "oncecount_"+todayNum+"_"+in.UserId) >= 150
|
|
}
|
|
}
|
|
//是否进入向导查询
|
|
//是否进入向导查询
|
|
resp.Data.IsInTSguide = func() bool {
|
|
resp.Data.IsInTSguide = func() bool {
|
|
//付费用户无免费订阅,不进入订阅向导页面
|
|
//付费用户无免费订阅,不进入订阅向导页面
|
|
- if common.IntAll((*user)["i_member_status"]) > 0 || common.IntAll((*user)["i_vip_status"]) > 0 {
|
|
|
|
|
|
+ if user.Member.Status > 0 || user.Vip.Status > 0 {
|
|
return false
|
|
return false
|
|
}
|
|
}
|
|
- o_jy, _ := (*user)["o_jy"].(map[string]interface{})
|
|
|
|
- iTsGuide := common.IntAll((*user)["i_ts_guide"])
|
|
|
|
- if iTsGuide == 2 || (iTsGuide == 0 && len(o_jy) == 0) {
|
|
|
|
|
|
+ if !user.Vip.HasKey {
|
|
return true
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
return false
|