|
@@ -2,6 +2,7 @@ package jy
|
|
|
|
|
|
import (
|
|
|
"app.yhyue.com/moapp/jybase/go-xweb/httpsession"
|
|
|
+ "app.yhyue.com/moapp/jypkg/middleground"
|
|
|
)
|
|
|
|
|
|
var SwitchService = &switchService{
|
|
@@ -26,10 +27,10 @@ type switchService struct {
|
|
|
* @param mongodb
|
|
|
* @return string 服务类型
|
|
|
*/
|
|
|
-func (s *switchService) Get(session *httpsession.Session, appid, host, key string) string {
|
|
|
+func (s *switchService) Get(session *httpsession.Session, middleground middleground.Middleground) string {
|
|
|
//userId, _ := session.Get("userId").(string)
|
|
|
v, _ := session.Get(s.SessionKey).(string)
|
|
|
- data := GetBigVipUserBaseMsg(appid, session, host, key)
|
|
|
+ data := GetBigVipUserBaseMsg(session, middleground)
|
|
|
//u, ok := m.FindById("user", userId, `{"i_member_status":1,"i_vip_status":1}`)
|
|
|
if data != nil {
|
|
|
if i_member_status := data.Status; v == s.Member && i_member_status > 0 {
|
|
@@ -48,12 +49,12 @@ func (s *switchService) Get(session *httpsession.Session, appid, host, key strin
|
|
|
return s.Free
|
|
|
}
|
|
|
|
|
|
-func (s *switchService) GetEntniche(session *httpsession.Session, appid, host, key string) string {
|
|
|
+func (s *switchService) GetEntniche(session *httpsession.Session, middleground middleground.Middleground) string {
|
|
|
sessMap := session.GetMultiple()
|
|
|
//userId, _ := sessMap["userId"].(string)
|
|
|
v, _ := sessMap[s.SessionKey].(string)
|
|
|
//u, ok := m.FindById("user", userId, `{"i_member_status":1,"i_vip_status":1}`)
|
|
|
- data := GetBigVipUserBaseMsg(appid, session, host, key)
|
|
|
+ data := GetBigVipUserBaseMsg(session, middleground)
|
|
|
/* if entId, entUserId := util.IntAll(sessMap["entId"]), util.IntAll(sessMap["entUserId"]); entId > 0 && entUserId > 0 {
|
|
|
//当前企业是否购买商机管理
|
|
|
if sql.CountBySql(`SELECT count(1) as count FROM entniche_info a inner join entniche_user b on (a.id=? and a.status=1 and ifnull(a.power_source,0)=0 and b.id=? and b.power=1)`, entId, entUserId) > 0 {
|
|
@@ -84,16 +85,16 @@ func (s *switchService) GetEntniche(session *httpsession.Session, appid, host, k
|
|
|
}
|
|
|
|
|
|
//所选服务是否是大会员
|
|
|
-func (s *switchService) IsMember(session *httpsession.Session, appid, host, key string) bool {
|
|
|
- return s.GetEntniche(session, appid, host, key) == s.Member
|
|
|
+func (s *switchService) IsMember(session *httpsession.Session, middleground middleground.Middleground) bool {
|
|
|
+ return s.GetEntniche(session, middleground) == s.Member
|
|
|
}
|
|
|
|
|
|
//所选服务是否是超级订阅
|
|
|
-func (s *switchService) IsVip(session *httpsession.Session, appid, host, key string) bool {
|
|
|
- return s.Get(session, appid, host, key) == s.Vip
|
|
|
+func (s *switchService) IsVip(session *httpsession.Session, middleground middleground.Middleground) bool {
|
|
|
+ return s.Get(session, middleground) == s.Vip
|
|
|
}
|
|
|
|
|
|
//所选服务是否是免费
|
|
|
-func (s *switchService) IsFree(session *httpsession.Session, appid, host, key string) bool {
|
|
|
- return s.Get(session, appid, host, key) == s.Free
|
|
|
+func (s *switchService) IsFree(session *httpsession.Session, middleground middleground.Middleground) bool {
|
|
|
+ return s.Get(session, middleground) == s.Free
|
|
|
}
|