浏览代码

feat:p618 bxsubscribe 省份订阅包设置向导调整

fuwencai 7 月之前
父节点
当前提交
6558110995

+ 5 - 0
jyBXSubscribe/rpc/internal/logic/getsubsomeinfologic.go

@@ -142,6 +142,11 @@ func (l *GetSubSomeInfoLogic) GetSubSomeInfo(in *bxsubscribe.SomeInfoReq) (*bxsu
 				switch in.UserType {
 				case SubFreeFlag:
 					resp.Data.Subsetinfo.Key = freegetsubKey(subinfo)
+					// 判断有没有省份订阅包
+					o_buyset_p, o_buyset_p_b := subinfo["o_buyset_p"].(map[string]interface{})
+					if o_buyset_p != nil && o_buyset_p_b {
+						resp.Data.Subsetinfo.Areacount += common.Int64All(o_buyset_p["areacount"])
+					}
 				case SubVipFlag:
 					o_buyset := common.ObjToMap(subinfo["o_buyset"])
 					if o_buyset != nil {

+ 9 - 1
jyBXSubscribe/rpc/internal/logic/savetsguidelogic.go

@@ -44,7 +44,7 @@ func (l *SaveTSGuideLogic) SaveTSGuide(in *bxsubscribe.SaveTSGuideReq) (*bxsubsc
 	entId, _ := strconv.ParseInt(in.EntId, 10, 64)
 	// 校验是否已经完成过订阅向导
 	//  查询订阅信息中的关键词和向导查询
-	data := IC.Compatible.Select(in.UserId, `{"i_ts_guide":1,"l_registedate":1,"o_member_jy":1}`)
+	data := IC.Compatible.Select(in.UserId, `{"i_ts_guide":1,"l_registedate":1,"o_member_jy":1,"o_jy":1}`)
 	if data != nil && len(*data) > 0 {
 		registedate := common.Int64All((*data)["l_registedate"])
 		if (in.UserType != SubFreeFlag && registedate < IC.C.GuideRegistedate) || common.Int64All((*data)["i_ts_guide"]) == tsGuideFinished {
@@ -67,6 +67,14 @@ func (l *SaveTSGuideLogic) SaveTSGuide(in *bxsubscribe.SaveTSGuideReq) (*bxsubsc
 		countLimit = 10
 		field = "o_jy.%s"
 		areaCountLimit = 1 // 免费用户
+		// 省份订阅包
+		o_jy, o_jyb := (*data)["o_jy"].(map[string]interface{})
+		if o_jy != nil && o_jyb {
+			o_buyset_p, o_buyset_p_b := o_jy["o_buyset_p"].(map[string]interface{})
+			if o_buyset_p != nil && o_buyset_p_b {
+				areaCountLimit += common.Int64All(o_buyset_p["areacount"])
+			}
+		}
 	case SubVipFlag:
 		if user.Vip.Status <= 0 {
 			return nil, errors.New("身份异常")