Browse Source

Merge branch 'dev_v4.9.69_wh1' of qmx/jy into feature/v4.9.69

王浩 8 months ago
parent
commit
eec868d638

+ 16 - 10
src/jfw/modules/publicapply/src/subscribe/entity/entity.go

@@ -86,40 +86,46 @@ func (this *ParamInfo) SetAreaByOneProvince() (b bool) {
 	}
 	return b
 }
-func (this *ParamInfo) IsSub() bool {
-	mData := config.Compatible.Select(this.UserId, `{"o_jy":1,"o_member_jy":1,"o_vipjy":1}`)
+func (this *ParamInfo) IsSub() (bool, string) {
+	mData := config.Compatible.Select(this.UserId, `{"o_jy":1,"o_member_jy":1,"o_vipjy":1,"i_vip_status":1,"i_member_status":1}`)
+	productType := "free"
 	if mData != nil && len(*mData) != 0 {
+		if memberStatus := gconv.Int64((*mData)["i_member_status"]); memberStatus > 0 {
+			productType = "member"
+		} else if vipStatus := gconv.Int64((*mData)["i_vip_status"]); vipStatus > 0 {
+			productType = "vip"
+		}
 		positionType := gconv.Int64(this.Session.Get("positionType"))
 		if positionType == 1 {
 			//企业身份
-			return false
+			return false, productType
 		}
 		o_jy, _ := (*mData)["o_jy"].(map[string]interface{})
 		if o_jy["o_area"] != nil {
-			return false
+			return false, productType
 		}
 		a_key, _ := o_jy["a_key"].([]interface{})
 		if len(a_key) > 0 {
-			return false
+			return false, productType
 		}
 		o_vipjy, _ := (*mData)["o_vipjy"].(map[string]interface{})
 		if o_vipjy["o_area"] != nil {
-			return false
+			return false, productType
 		}
 		a_key, _ = o_vipjy["a_key"].([]interface{})
 		if len(a_key) > 0 {
-			return false
+			return false, productType
 		}
 		o_member_jy, _ := (*mData)["o_member_jy"].(map[string]interface{})
 		if o_member_jy["o_area"] != nil {
-			return false
+			return false, productType
 		}
 		a_key, _ = o_member_jy["a_key"].([]interface{})
 		if len(a_key) > 0 {
-			return false
+			return false, productType
 		}
 	}
-	return true
+	return true, productType
 }
 
 type RuleStruct struct {

+ 4 - 2
src/jfw/modules/publicapply/src/subscribe/service/service.go

@@ -31,14 +31,16 @@ func (this *ServiceStruct) IsSub() {
 		}
 		newFN := entity.NewParamInfo(userId, this.Session())
 		area, city, district := newFN.HistorySearch(userId)
+		isSubscribe, productType := newFN.IsSub()
 		returnData := map[string]interface{}{
 			"frequentContinuous": config.Config.FrequentContinuous,
 			"screenNumb":         config.Config.ScreenNumb,
-			"isSubscribe":        newFN.IsSub(),
+			"isSubscribe":        isSubscribe,
 			"area":               area,
 			"city":               city,
 			"district":           district,
-			"positionType":       gconv.Int64(this.GetSession("userId")),
+			"positionType":       gconv.Int64(this.GetSession("positionType")),
+			"productType":        productType,
 		}
 		return Result{Data: returnData}
 	}()