浏览代码

身份判断处理

WH01243 2 年之前
父节点
当前提交
2e3a1768a0
共有 2 个文件被更改,包括 16 次插入6 次删除
  1. 6 1
      jyBXSubscribe/rpc/internal/logic/getsublistlogic.go
  2. 10 5
      jyBXSubscribe/rpc/internal/logic/setreadlogic.go

+ 6 - 1
jyBXSubscribe/rpc/internal/logic/getsublistlogic.go

@@ -61,7 +61,12 @@ func (l *GetSubListLogic) GetSubList(in *bxsubscribe.SubscribeInfosReq) (*bxsubs
 		UserType:         in.UserType,
 	}
 	//主体处理(fType:普通用户;vType:超级订阅用户;mType:大会员用户;eType:商机管理用户)
-	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)
+	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
 		//主体等于企业的

+ 10 - 5
jyBXSubscribe/rpc/internal/logic/setreadlogic.go

@@ -31,12 +31,17 @@ func (l *SetReadLogic) SetRead(in *bxsubscribe.SetReadReq) (*bxsubscribe.StatusR
 	resp := &bxsubscribe.StatusResp{}
 	//主体处理(fType:普通用户;vType:超级订阅用户;mType:大会员用户;eType:商机管理用户)
 	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)
 	return resp, nil
 }