wangchuanjin 2 năm trước cách đây
mục cha
commit
efde1dd36e

+ 3 - 3
src/jfw/modules/subscribepay/src/entity/order.go

@@ -562,7 +562,7 @@ func vipFirstBuy(m map[string]interface{}, userId string, session *httpsession.S
 	req_price := qu.IntAll(m["price"])              //前端展示金额
 	order_phone := qu.ObjToString(m["order_phone"]) //p19.3用户信息采集 手机号
 	now := time.Now()
-	userData, oldBuyset, _ := JyVipSubStruct.GetVipDetail(session.GetMultiple())
+	userData, oldBuyset, _ := JyVipSubStruct.GetVipDetail(userId)
 	pass := func() bool { //校验订单是否合法
 		if orderType == 1 {
 			vipStatus := qu.IntAll((*userData)["i_vip_status"])
@@ -679,7 +679,7 @@ func vipRenew(m map[string]interface{}, userId string, session *httpsession.Sess
 		return nil, err.Error()
 	}
 
-	rData, buyset, isVip := JyVipSubStruct.GetVipDetail(session.GetMultiple())
+	rData, buyset, isVip := JyVipSubStruct.GetVipDetail(userId)
 	if !isVip {
 		return nil, "请求异常,非vip状态"
 	}
@@ -746,7 +746,7 @@ func vipUpgrade(m map[string]interface{}, userId string, session *httpsession.Se
 	if order_phone != "" && !jy.PhoneReg.MatchString(order_phone) {
 		return nil, "手机号格式异常"
 	}
-	rData, oldBuyset, isVip := JyVipSubStruct.GetVipDetail(session.GetMultiple())
+	rData, oldBuyset, isVip := JyVipSubStruct.GetVipDetail(userId)
 	if !isVip {
 		return nil, "请求异常,非vip状态"
 	}

+ 2 - 2
src/jfw/modules/subscribepay/src/entity/shareFission.go

@@ -100,8 +100,8 @@ func AddPower(s_m_openid, userId string, r *http.Request) {
 	starttime,endtime:权益开始结束时间
 	types:订单类型  1: 仅延长周期  2: 开通权益
 */
-func Order(userid, starttime, endtime string, types, dayNum int, remark string, sessVal map[string]interface{}) bool {
-	_, buyset, isvip := JyVipSubStruct.GetVipDetail(sessVal)
+func Order(userid, starttime, endtime string, types, dayNum int, remark string) bool {
+	_, buyset, isvip := JyVipSubStruct.GetVipDetail(userid)
 	filter := VipSimpleMsg{
 		Area:       nil,
 		Industry:   nil,

+ 2 - 3
src/jfw/modules/subscribepay/src/entity/subscribeVip.go

@@ -17,7 +17,6 @@ import (
 	. "app.yhyue.com/moapp/jybase/date"
 	"app.yhyue.com/moapp/jybase/redis"
 	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
-	"app.yhyue.com/moapp/jypkg/public"
 	"go.mongodb.org/mongo-driver/bson"
 )
 
@@ -598,8 +597,8 @@ func (this *vipSubscribeStruct) SubChange(userId string, oldVip, areaNew *map[st
 
 // 获取省份,城市,行业购买内容
 // [省份,城市,行业]
-func (this *vipSubscribeStruct) GetVipDetail(sessVal map[string]interface{}) (*map[string]interface{}, *SubvipBuySet, bool) {
-	mData := public.GetCompatibleUser(&util.MQFW, sessVal, map[string]int{"o_vipjy": 1, "i_vip_status": 1, "l_vip_endtime": 1, "l_vip_starttime": 1, "isread": 1})
+func (this *vipSubscribeStruct) GetVipDetail(id string) (*map[string]interface{}, *SubvipBuySet, bool) {
+	mData := util.Compatible.GetCompatibleUser(id, `{"o_vipjy":1,"i_vip_status":1,"l_vip_endtime":1,"l_vip_starttime":1,"isread":1}`)
 	//是否处于vip状态
 	vipStatus := qutil.IntAll((*mData)["i_vip_status"])
 	tmp := qutil.ObjToMap((*qutil.ObjToMap((*mData)["o_vipjy"]))["o_buyset"])

+ 1 - 1
src/jfw/modules/subscribepay/src/go.mod

@@ -4,7 +4,7 @@ go 1.18
 
 require (
 	app.yhyue.com/moapp/jybase v0.0.0-20230117032034-ad7c00ffe11a
-	app.yhyue.com/moapp/jypkg v0.0.0-20230207090818-8d6a5427e8f2
+	app.yhyue.com/moapp/jypkg v0.0.0-20230207123721-48a5d7716c73
 	bp.jydev.jianyu360.cn/BaseService/pushpkg v0.0.0-20230203052057-bbba3a4671fd
 	github.com/SKatiyar/qr v0.0.0-20151201054752-25b6bdf44e67
 	github.com/dchest/captcha v1.0.0

+ 2 - 2
src/jfw/modules/subscribepay/src/go.sum

@@ -13,8 +13,8 @@ app.yhyue.com/moapp/jybase v0.0.0-20220802080941-07f401baab8b/go.mod h1:HelrO6tc
 app.yhyue.com/moapp/jybase v0.0.0-20230109015757-aa3d5e19b196/go.mod h1:zB47XTeJvpcbtBRYgkQuxOICWNexiZfbUO+7aUf6mNs=
 app.yhyue.com/moapp/jybase v0.0.0-20230117032034-ad7c00ffe11a h1:wD4aWPSYdiX1cIP4lzzPD2s7fYhKa3muIf97l9tonJE=
 app.yhyue.com/moapp/jybase v0.0.0-20230117032034-ad7c00ffe11a/go.mod h1:zB47XTeJvpcbtBRYgkQuxOICWNexiZfbUO+7aUf6mNs=
-app.yhyue.com/moapp/jypkg v0.0.0-20230207090818-8d6a5427e8f2 h1:tIviFlX7SbRMxsRVW2Iwh75jWFx/YpM5C2hfG1tatVQ=
-app.yhyue.com/moapp/jypkg v0.0.0-20230207090818-8d6a5427e8f2/go.mod h1:0DqPlGxaufZlKaLoRndTWG4j3qUQqJ6MNZCmoPcMqSg=
+app.yhyue.com/moapp/jypkg v0.0.0-20230207123721-48a5d7716c73 h1:+96bnwYH7EeqY2RE7/7vvRP/jkpkkkQAWEW3UN1lXGo=
+app.yhyue.com/moapp/jypkg v0.0.0-20230207123721-48a5d7716c73/go.mod h1:0DqPlGxaufZlKaLoRndTWG4j3qUQqJ6MNZCmoPcMqSg=
 app.yhyue.com/moapp/message v0.0.0-20221223100203-6402e389d9ae h1:6rDDaz6yxvE8viTSzEBwKYOFWq14TMfuBivSazUZMz4=
 app.yhyue.com/moapp/message v0.0.0-20221223100203-6402e389d9ae/go.mod h1:b0zZHev3gmJao1Fo+2Z2KPVjsuLOJVvVxf+kCnu9WkA=
 bp.jydev.jianyu360.cn/BP/jynsq v0.0.0-20220222052708-ebc43af90698/go.mod h1:ojo/AUH9Yr1wzarEjOaNMkj1Cet/9r8IgLyba64Z52E=

+ 1 - 1
src/jfw/modules/subscribepay/src/rpcfollow/share.go

@@ -82,7 +82,7 @@ func (s *JyPayRpc) ShareFissionNew(p *frpc.JYShareUserIdsRes, r *frpc.JYShareRes
 				st, et := "", ""
 				st = time.Unix(endtime, 0).Format(Date_Full_Layout)
 				et = endT.Format(Date_Full_Layout)
-				if !entity.Order(userId, st, et, types, ps.TimeExpand, ps.Remark, sessVal) {
+				if !entity.Order(userId, st, et, types, ps.TimeExpand, ps.Remark) {
 					r.Error_code = -2
 					errArr = append(errArr, map[string]interface{}{
 						"code":   -2,

+ 1 - 1
src/jfw/modules/subscribepay/src/service/salesCreateOrder.go

@@ -404,7 +404,7 @@ func (this *SalesCreateOrder) GetSubBuyMsg() {
 		if err != nil {
 			return &entity.FuncResult{false, err, nil}
 		}
-		rData, buyset, vip := entity.JyVipSubStruct.GetVipDetail(this.Session().GetMultiple())
+		rData, buyset, vip := entity.JyVipSubStruct.GetVipDetail(userId)
 		if rData == nil || len(*rData) == 0 {
 			return &entity.FuncResult{false, errors.New("获取信息失败"), nil}
 		}

+ 3 - 3
src/jfw/modules/subscribepay/src/service/vipSubscribeChange.go

@@ -41,7 +41,7 @@ func (this *SubscribeChange) GetSubBuyMsg() {
 	r := func() *entity.FuncResult {
 		ent_id := qutil.IntAll(this.GetSession("entId"))
 		entUserId := qutil.IntAll(this.GetSession("entUserId"))
-		rData, buyset, vip := entity.JyVipSubStruct.GetVipDetail(this.Session().GetMultiple())
+		rData, buyset, vip := entity.JyVipSubStruct.GetVipDetail(userId)
 		if rData == nil || len(*rData) == 0 {
 			return &entity.FuncResult{false, errors.New("获取信息失败"), nil}
 		}
@@ -112,7 +112,7 @@ func (this *SubscribeChange) SaveChange() {
 		if len(industry) == 1 && industry[0] == "" {
 			industry = []string{}
 		}
-		rData, oldBuyset, isVip := entity.JyVipSubStruct.GetVipDetail(this.Session().GetMultiple())
+		rData, oldBuyset, isVip := entity.JyVipSubStruct.GetVipDetail(userId)
 		if !isVip {
 			return &entity.FuncResult{false, errors.New("请求异常,非vip状态"), nil}
 		}
@@ -191,7 +191,7 @@ func (this *SubscribeChange) Upgrade() {
 		openId := qutil.ObjToString(this.GetSession("s_m_openid"))
 		order_phone := this.GetString("order_phone") //p19.3用户信息采集 手机号
 
-		rData, oldBuyset, isVip := entity.JyVipSubStruct.GetVipDetail(this.Session().GetMultiple())
+		rData, oldBuyset, isVip := entity.JyVipSubStruct.GetVipDetail(userId)
 		if !isVip {
 			return &entity.FuncResult{false, errors.New("请求异常,非vip状态"), nil}
 		}

+ 3 - 3
src/jfw/modules/subscribepay/src/service/vipSubscribePay.go

@@ -68,7 +68,7 @@ func CommonBilling(area *map[string]interface{}, timeRenew, userId, lotteryId st
 		//计算价格
 		original_price = entity.JyVipSubStruct.GetSubVipPrice(buyset, date_count, date_unit)
 	} else if userMsg.VipStatus > 0 { //2:续费价格(只延长时间);3:升级价格(升级只升级地区)
-		rData, oldBuyset, _ := entity.JyVipSubStruct.GetVipDetail(session.GetMultiple())
+		rData, oldBuyset, _ := entity.JyVipSubStruct.GetVipDetail(userId)
 		switch orderType {
 		case 2:
 			now := time.Now()
@@ -198,7 +198,7 @@ func (this *SubVipPayOrder) CreateOrder() {
 			}
 		}*/
 		now := time.Now()
-		userData, oldBuyset, _ := entity.JyVipSubStruct.GetVipDetail(this.Session().GetMultiple())
+		userData, oldBuyset, _ := entity.JyVipSubStruct.GetVipDetail(userId)
 		isgive := false
 		pass := func() bool { //校验订单是否合法
 			if orderType == 1 {
@@ -422,7 +422,7 @@ func (this *SubVipPayOrder) Renew() {
 			return &entity.FuncResult{false, err, nil}
 		}
 
-		rData, buyset, isVip := entity.JyVipSubStruct.GetVipDetail(this.Session().GetMultiple())
+		rData, buyset, isVip := entity.JyVipSubStruct.GetVipDetail(userId)
 		if !isVip {
 			return &entity.FuncResult{false, errors.New("请求异常,非vip状态"), nil}
 		}

+ 2 - 0
src/jfw/modules/subscribepay/src/util/db.go

@@ -3,6 +3,7 @@ package util
 import (
 	. "jy/src/jfw/modules/subscribepay/src/config"
 
+	"app.yhyue.com/moapp/jypkg/compatible"
 	p "bp.jydev.jianyu360.cn/BaseService/pushpkg/p"
 
 	qutil "app.yhyue.com/moapp/jybase/common"
@@ -113,4 +114,5 @@ func init() {
 	DataReport_WTMCS = p.NewWxTplMsgCustoms(Mysql, MessageConfig.WxTpl_DataReport.Id, MessageConfig.WxTpl_DataReport.First.Value)
 	PaySuccess_WTMCS = p.NewWxTplMsgCustoms(Mysql, MessageConfig.WxTpl_PaySuccess.Id, MessageConfig.WxTpl_PaySuccess.First.Value)
 	Unpaid_WTMCS = p.NewWxTplMsgCustoms(Mysql, MessageConfig.WxTpl_Unpaid.Id, MessageConfig.WxTpl_Unpaid.First.Value)
+	Compatible = compatible.NewCompatible(&MQFW, InfoMysql, Mysql)
 }

+ 2 - 0
src/jfw/modules/subscribepay/src/util/util.go

@@ -2,6 +2,7 @@ package util
 
 import (
 	qutil "app.yhyue.com/moapp/jybase/common"
+	"app.yhyue.com/moapp/jypkg/compatible"
 	. "bp.jydev.jianyu360.cn/BaseService/pushpkg/p"
 )
 
@@ -11,6 +12,7 @@ var (
 	DataReport_WTMCS *WxTplMsgCustoms
 	PaySuccess_WTMCS *WxTplMsgCustoms
 	Unpaid_WTMCS     *WxTplMsgCustoms
+	Compatible       *compatible.Compatible
 )
 
 func ConfirmIntArr(arr []interface{}) []int {