|
@@ -365,6 +365,7 @@ func (s *subscribePush) getDatasFromMysql(spqp *SubPushQueryParam, starttime, en
|
|
|
} else {
|
|
|
if spqp.IsEnt {
|
|
|
if spqp.BuySubject == 1 {
|
|
|
+ //企业主体是企业的企业查询
|
|
|
if spqp.UserType == SubVipFlag {
|
|
|
userStr = fmt.Sprintf(" a.entid='%s' and (a.source > 1) and (a.product=1) ", spqp.EntId)
|
|
|
|
|
@@ -375,15 +376,32 @@ func (s *subscribePush) getDatasFromMysql(spqp *SubPushQueryParam, starttime, en
|
|
|
userStr = fmt.Sprintf(" a.entid='%s' and (a.source>1) and (a.product<1) ", spqp.EntId)
|
|
|
}
|
|
|
} else {
|
|
|
- userStr = fmt.Sprintf(" a.entid='%s' and a.product < 1", spqp.EntId)
|
|
|
+ //企业主体是个人的企业查询
|
|
|
+ if s.ModuleFlag == EntnicheFlag {
|
|
|
+ userStr = fmt.Sprintf(" a.entid='%s' and a.product < 1", spqp.EntId)
|
|
|
+ } else {
|
|
|
+ userStr = fmt.Sprintf(" a.entid='%s'", spqp.EntId)
|
|
|
+ }
|
|
|
}
|
|
|
} else {
|
|
|
- if spqp.UserType == SubVipFlag {
|
|
|
- userStr = fmt.Sprintf(" a.userid='%s' and (a.product=1)", common.If(s.ModuleFlag == EntnicheFlag, spqp.EntUserId, common.InterfaceToStr(spqp.NewUserId)))
|
|
|
- } else if spqp.UserType == MemberFlag {
|
|
|
- userStr = fmt.Sprintf(" a.userid='%s' and (a.product=2)", common.If(s.ModuleFlag == EntnicheFlag, spqp.EntUserId, common.InterfaceToStr(spqp.NewUserId)))
|
|
|
+ if spqp.BuySubject == 1 {
|
|
|
+ //企业主体是企业的个人查询
|
|
|
+ if spqp.UserType == SubVipFlag {
|
|
|
+ userStr = fmt.Sprintf(" a.userid='%s' and (a.product=1)", common.If(s.ModuleFlag == EntnicheFlag, spqp.EntUserId, common.InterfaceToStr(spqp.NewUserId)))
|
|
|
+ } else if spqp.UserType == MemberFlag {
|
|
|
+ userStr = fmt.Sprintf(" a.userid='%s' and (a.product=2)", common.If(s.ModuleFlag == EntnicheFlag, spqp.EntUserId, common.InterfaceToStr(spqp.NewUserId)))
|
|
|
+ } else {
|
|
|
+ userStr = fmt.Sprintf(" a.userid='%s' and (a.product<1)", common.If(s.ModuleFlag == EntnicheFlag, spqp.EntUserId, common.InterfaceToStr(spqp.NewUserId)))
|
|
|
+ }
|
|
|
} else {
|
|
|
- userStr = fmt.Sprintf(" a.userid='%s' and (a.product<1)", common.If(s.ModuleFlag == EntnicheFlag, spqp.EntUserId, common.InterfaceToStr(spqp.NewUserId)))
|
|
|
+ if s.ModuleFlag == EntnicheFlag {
|
|
|
+ //老商机管理个人订阅查询
|
|
|
+ userStr = fmt.Sprintf(" a.userid='%s' and a.product < 1", common.If(s.ModuleFlag == EntnicheFlag, spqp.EntUserId, common.InterfaceToStr(spqp.NewUserId)))
|
|
|
+ } else {
|
|
|
+ //个人订阅查询
|
|
|
+ userStr = fmt.Sprintf(" a.userid='%s'", common.If(s.ModuleFlag == EntnicheFlag, spqp.EntUserId, common.InterfaceToStr(spqp.NewUserId)))
|
|
|
+ }
|
|
|
+ // userStr = fmt.Sprintf(" a.userid='%s'", common.If(s.ModuleFlag == EntnicheFlag, spqp.EntUserId, common.InterfaceToStr(spqp.NewUserId)))
|
|
|
}
|
|
|
}
|
|
|
|