|
@@ -31,12 +31,17 @@ func (l *SetReadLogic) SetRead(in *bxsubscribe.SetReadReq) (*bxsubscribe.StatusR
|
|
resp := &bxsubscribe.StatusResp{}
|
|
resp := &bxsubscribe.StatusResp{}
|
|
//主体处理(fType:普通用户;vType:超级订阅用户;mType:大会员用户;eType:商机管理用户)
|
|
//主体处理(fType:普通用户;vType:超级订阅用户;mType:大会员用户;eType:商机管理用户)
|
|
userType := in.UserType
|
|
userType := in.UserType
|
|
- if in.UserType == model.SubVipFlag || in.UserType == model.MemberFlag {
|
|
|
|
- infoCount := IC.MainMysql.CountBySql("select count(id) from entniche_wait_empower where ent_id=? and end_time>NOW() and (product_type like '%VIP订阅%' or product_type like '%大会员%') ", in.EntId)
|
|
|
|
- if infoCount > 0 {
|
|
|
|
- in.UserType = model.EntnicheFlag
|
|
|
|
- }
|
|
|
|
|
|
+ infoCount := int64(0)
|
|
|
|
+ if in.UserType == model.MemberFlag {
|
|
|
|
+ infoCount = IC.MainMysql.CountBySql("select count(id) from entniche_wait_empower where ent_id=? and end_time>NOW() and product_type like '%大会员%' ", in.EntId)
|
|
|
|
+ } else if in.UserType == model.SubVipFlag {
|
|
|
|
+ infoCount = IC.MainMysql.CountBySql("select count(id) from entniche_wait_empower where ent_id=? and end_time>NOW() and product_type like '%VIP订阅%' ", in.EntId)
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ if infoCount > 0 {
|
|
|
|
+ in.UserType = model.EntnicheFlag
|
|
|
|
+ }
|
|
|
|
+
|
|
model.NewSubscribePush(in.UserType).SetRead(in.NewUserId, in.Vsid, in.UserId, in.EntUserId, in.EntId, in.IsEnt, userType)
|
|
model.NewSubscribePush(in.UserType).SetRead(in.NewUserId, in.Vsid, in.UserId, in.EntUserId, in.EntId, in.IsEnt, userType)
|
|
return resp, nil
|
|
return resp, nil
|
|
}
|
|
}
|