|
@@ -32,7 +32,6 @@ type SubscribePush struct {
|
|
func (sp *SubscribePush) VipSwitch() {
|
|
func (sp *SubscribePush) VipSwitch() {
|
|
userId, _ := sp.GetSession("userId").(string)
|
|
userId, _ := sp.GetSession("userId").(string)
|
|
//entUserId := util.IntAll(sp.GetSession("entUserId"))
|
|
//entUserId := util.IntAll(sp.GetSession("entUserId"))
|
|
- fmt.Println("11111111111",util.IntAll(sp.GetSession("entUserId")))
|
|
|
|
rData, errMsg := func() (interface{}, error) {
|
|
rData, errMsg := func() (interface{}, error) {
|
|
if userId == "" {
|
|
if userId == "" {
|
|
return nil, fmt.Errorf("未登录")
|
|
return nil, fmt.Errorf("未登录")
|
|
@@ -40,9 +39,8 @@ func (sp *SubscribePush) VipSwitch() {
|
|
switchOk := false
|
|
switchOk := false
|
|
vt := sp.GetString("vt")
|
|
vt := sp.GetString("vt")
|
|
if vt == "" {
|
|
if vt == "" {
|
|
- vt=jy.SwitchService.GetEntniche(sp.Session(), db.Mgo,db.Mysql)
|
|
|
|
|
|
+ vt = jy.SwitchService.GetEntniche(sp.Session(), db.Mgo, db.Mysql)
|
|
sp.SetSession(jy.SwitchService.SessionKey, vt)
|
|
sp.SetSession(jy.SwitchService.SessionKey, vt)
|
|
- fmt.Println("1231233",vt)
|
|
|
|
} else if vt == jy.SubVipFlag {
|
|
} else if vt == jy.SubVipFlag {
|
|
vipMsg := jy.GetBigVipUserBaseMsg(userId, db.Mysql, db.Mgo)
|
|
vipMsg := jy.GetBigVipUserBaseMsg(userId, db.Mysql, db.Mgo)
|
|
if vipMsg.VipStatus <= 0 {
|
|
if vipMsg.VipStatus <= 0 {
|
|
@@ -87,11 +85,9 @@ func (sp *SubscribePush) HasPushHistory() {
|
|
|
|
|
|
vipType := sp.GetString("vt")
|
|
vipType := sp.GetString("vt")
|
|
if vipType == "" { //默认取已切换的企业
|
|
if vipType == "" { //默认取已切换的企业
|
|
- vipType = jy.SwitchService.GetEntniche(sp.Session(), db.Mgo,db.Mysql)
|
|
|
|
|
|
+ vipType = jy.SwitchService.GetEntniche(sp.Session(), db.Mgo, db.Mysql)
|
|
}
|
|
}
|
|
- fmt.Println("12312",vipType,userId, util.IntAll(sp.GetSession("entUserId")))
|
|
|
|
- if vipType==jy.SwitchService.Entniche{
|
|
|
|
- fmt.Println(util.IntAll(sp.GetSession("entUserId")))
|
|
|
|
|
|
+ if vipType == jy.SwitchService.Entniche {
|
|
userId = fmt.Sprint(util.IntAll(sp.GetSession("entUserId")))
|
|
userId = fmt.Sprint(util.IntAll(sp.GetSession("entUserId")))
|
|
}
|
|
}
|
|
go entity.HistoryPush.UpdateUserPushUnread(userId, vipType)
|
|
go entity.HistoryPush.UpdateUserPushUnread(userId, vipType)
|
|
@@ -208,9 +204,9 @@ func (sp *SubscribePush) HistoryPaging() {
|
|
}
|
|
}
|
|
vipType := sp.GetString("vt")
|
|
vipType := sp.GetString("vt")
|
|
if vipType == "" { //默认取已切换的企业
|
|
if vipType == "" { //默认取已切换的企业
|
|
- vipType=jy.SwitchService.GetEntniche(sp.Session(), db.Mgo,db.Mysql)
|
|
|
|
|
|
+ vipType = jy.SwitchService.GetEntniche(sp.Session(), db.Mgo, db.Mysql)
|
|
}
|
|
}
|
|
- if vipType==jy.SwitchService.Entniche{
|
|
|
|
|
|
+ if vipType == jy.SwitchService.Entniche {
|
|
userId = fmt.Sprint(util.IntAll(sp.GetSession("entUserId")))
|
|
userId = fmt.Sprint(util.IntAll(sp.GetSession("entUserId")))
|
|
}
|
|
}
|
|
pageNum, _ := sp.GetInteger("pageNum")
|
|
pageNum, _ := sp.GetInteger("pageNum")
|
|
@@ -272,7 +268,7 @@ func (sp *SubscribePush) SetRead() error {
|
|
}
|
|
}
|
|
vipType := sp.GetString("vt")
|
|
vipType := sp.GetString("vt")
|
|
if vipType == "" { //默认取已切换的企业
|
|
if vipType == "" { //默认取已切换的企业
|
|
- vipType=jy.SwitchService.GetEntniche(sp.Session(), db.Mgo,db.Mysql)
|
|
|
|
|
|
+ vipType = jy.SwitchService.GetEntniche(sp.Session(), db.Mgo, db.Mysql)
|
|
}
|
|
}
|
|
if userId := util.ObjToString(sp.GetSession("userId")); userId != "" {
|
|
if userId := util.ObjToString(sp.GetSession("userId")); userId != "" {
|
|
if vipType == jy.SwitchService.Member {
|
|
if vipType == jy.SwitchService.Member {
|
|
@@ -303,7 +299,7 @@ func (sp *SubscribePush) GetPushCount() error {
|
|
if userId != "" {
|
|
if userId != "" {
|
|
vipType := sp.GetString("vt")
|
|
vipType := sp.GetString("vt")
|
|
if vipType == "" { //默认取已切换的企业
|
|
if vipType == "" { //默认取已切换的企业
|
|
- vipType=jy.SwitchService.GetEntniche(sp.Session(), db.Mgo,db.Mysql)
|
|
|
|
|
|
+ vipType = jy.SwitchService.GetEntniche(sp.Session(), db.Mgo, db.Mysql)
|
|
|
|
|
|
}
|
|
}
|
|
matchway, _ := sp.GetInteger("matchway")
|
|
matchway, _ := sp.GetInteger("matchway")
|
|
@@ -322,7 +318,7 @@ func (sp *SubscribePush) GetPushAllCount() error {
|
|
index, _ := sp.GetInteger("index")
|
|
index, _ := sp.GetInteger("index")
|
|
vipType := sp.GetString("vt")
|
|
vipType := sp.GetString("vt")
|
|
if vipType == "" { //默认取已切换的企业
|
|
if vipType == "" { //默认取已切换的企业
|
|
- vipType=jy.SwitchService.GetEntniche(sp.Session(), db.Mgo,db.Mysql)
|
|
|
|
|
|
+ vipType = jy.SwitchService.GetEntniche(sp.Session(), db.Mgo, db.Mysql)
|
|
}
|
|
}
|
|
sp.ServeJson(map[string]interface{}{
|
|
sp.ServeJson(map[string]interface{}{
|
|
"count": entity.SubViewDatasCount(userId, vipType, sp.GetString("item"), index),
|
|
"count": entity.SubViewDatasCount(userId, vipType, sp.GetString("item"), index),
|