|
@@ -31,6 +31,8 @@ type SubscribePush struct {
|
|
//VipSwitch 大会员、超级订阅、商机管理切换
|
|
//VipSwitch 大会员、超级订阅、商机管理切换
|
|
func (sp *SubscribePush) VipSwitch() {
|
|
func (sp *SubscribePush) VipSwitch() {
|
|
userId, _ := sp.GetSession("userId").(string)
|
|
userId, _ := sp.GetSession("userId").(string)
|
|
|
|
+ //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("未登录")
|
|
@@ -38,7 +40,9 @@ func (sp *SubscribePush) VipSwitch() {
|
|
switchOk := false
|
|
switchOk := false
|
|
vt := sp.GetString("vt")
|
|
vt := sp.GetString("vt")
|
|
if vt == "" {
|
|
if 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)
|
|
|
|
+ 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 {
|
|
@@ -80,13 +84,15 @@ func (sp *SubscribePush) HasPushHistory() {
|
|
if userId == "" {
|
|
if userId == "" {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
+
|
|
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{
|
|
if vipType==jy.SwitchService.Entniche{
|
|
fmt.Println(util.IntAll(sp.GetSession("entUserId")))
|
|
fmt.Println(util.IntAll(sp.GetSession("entUserId")))
|
|
- userId = util.ObjToString(sp.GetSession("entUserId"))
|
|
|
|
|
|
+ userId = fmt.Sprint(util.IntAll(sp.GetSession("entUserId")))
|
|
}
|
|
}
|
|
go entity.HistoryPush.UpdateUserPushUnread(userId, vipType)
|
|
go entity.HistoryPush.UpdateUserPushUnread(userId, vipType)
|
|
user, _ := jy.NewSubscribePush().UserInfo(db.Mgo, userId)
|
|
user, _ := jy.NewSubscribePush().UserInfo(db.Mgo, userId)
|
|
@@ -202,11 +208,10 @@ func (sp *SubscribePush) HistoryPaging() {
|
|
}
|
|
}
|
|
vipType := sp.GetString("vt")
|
|
vipType := sp.GetString("vt")
|
|
if vipType == "" { //默认取已切换的企业
|
|
if vipType == "" { //默认取已切换的企业
|
|
- vipType = jy.SwitchService.Get(sp.Session(), db.Mgo)
|
|
|
|
|
|
+ vipType=jy.SwitchService.GetEntniche(sp.Session(), db.Mgo,db.Mysql)
|
|
}
|
|
}
|
|
- log.Println("ssss", util.ObjToString(sp.GetSession("entUserId")))
|
|
|
|
if vipType==jy.SwitchService.Entniche{
|
|
if vipType==jy.SwitchService.Entniche{
|
|
- userId = util.ObjToString(sp.GetSession("entUserId"))
|
|
|
|
|
|
+ userId = fmt.Sprint(util.IntAll(sp.GetSession("entUserId")))
|
|
}
|
|
}
|
|
pageNum, _ := sp.GetInteger("pageNum")
|
|
pageNum, _ := sp.GetInteger("pageNum")
|
|
PageSize, _ := sp.GetInteger("pageSize")
|
|
PageSize, _ := sp.GetInteger("pageSize")
|
|
@@ -235,7 +240,6 @@ func (sp *SubscribePush) HistoryPaging() {
|
|
} else {
|
|
} else {
|
|
spqp.PushMysql = db.MysqlPush
|
|
spqp.PushMysql = db.MysqlPush
|
|
}
|
|
}
|
|
- log.Println(3333)
|
|
|
|
hasNextPage, total, list := jy.NewSubscribePush(vipType).Datas(spqp)
|
|
hasNextPage, total, list := jy.NewSubscribePush(vipType).Datas(spqp)
|
|
//查询是否收藏
|
|
//查询是否收藏
|
|
jy.NewSubscribePush().MakeCollection(userId, db.Mysql, list)
|
|
jy.NewSubscribePush().MakeCollection(userId, db.Mysql, list)
|
|
@@ -268,11 +272,13 @@ func (sp *SubscribePush) SetRead() error {
|
|
}
|
|
}
|
|
vipType := sp.GetString("vt")
|
|
vipType := sp.GetString("vt")
|
|
if vipType == "" { //默认取已切换的企业
|
|
if vipType == "" { //默认取已切换的企业
|
|
- vipType = jy.SwitchService.Get(sp.Session(), db.Mgo)
|
|
|
|
|
|
+ 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 {
|
|
jy.NewSubscribePush(vipType).Visit(db.MysqlMemberPush, userId, vsid)
|
|
jy.NewSubscribePush(vipType).Visit(db.MysqlMemberPush, userId, vsid)
|
|
|
|
+ } else if vipType == jy.SwitchService.Entniche {
|
|
|
|
+ jy.NewSubscribePush(vipType).Visit(db.MysqlEntnichePush, userId, vsid)
|
|
} else {
|
|
} else {
|
|
jy.NewSubscribePush(vipType).Visit(db.MysqlPush, userId, vsid)
|
|
jy.NewSubscribePush(vipType).Visit(db.MysqlPush, userId, vsid)
|
|
}
|
|
}
|
|
@@ -297,7 +303,8 @@ func (sp *SubscribePush) GetPushCount() error {
|
|
if userId != "" {
|
|
if userId != "" {
|
|
vipType := sp.GetString("vt")
|
|
vipType := sp.GetString("vt")
|
|
if vipType == "" { //默认取已切换的企业
|
|
if vipType == "" { //默认取已切换的企业
|
|
- vipType = jy.SwitchService.Get(sp.Session(), db.Mgo)
|
|
|
|
|
|
+ vipType=jy.SwitchService.GetEntniche(sp.Session(), db.Mgo,db.Mysql)
|
|
|
|
+
|
|
}
|
|
}
|
|
matchway, _ := sp.GetInteger("matchway")
|
|
matchway, _ := sp.GetInteger("matchway")
|
|
sp.ServeJson(map[string]interface{}{
|
|
sp.ServeJson(map[string]interface{}{
|
|
@@ -315,7 +322,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.Get(sp.Session(), db.Mgo)
|
|
|
|
|
|
+ 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),
|