WH01243 пре 4 месеци
родитељ
комит
5a4de51a61
1 измењених фајлова са 21 додато и 2 уклоњено
  1. 21 2
      src/jfw/front/singleLogin.go

+ 21 - 2
src/jfw/front/singleLogin.go

@@ -46,12 +46,14 @@ const (
 func (this *SingleLogin) VipGiftUrl(key string) error {
 	var redirectUrl = ""
 	isSubscribe := false
+	isBinding := false
+	isSame := false
 	chatIdInt := gconv.Int64(encrypt.SE.Decode4HexByCheck(key))
 	isWxB := public.CheckWxBrowser(this.Request)
 	sess := this.Session().GetMultiple()
 	userId, _ := sess["userId"].(string)
 	openid := ""
-	log.Println("1111", key, chatIdInt, isWxB, userId, this.GetString("state"))
+	log.Println("1111", key, chatIdInt, isWxB, userId)
 	if isWxB && userId == "" {
 		if this.GetString("state") == "wx" {
 			//微信跳回来的
@@ -78,8 +80,25 @@ func (this *SingleLogin) VipGiftUrl(key string) error {
 			//没有关注  跳转关注页面
 		} else {
 			isSubscribe = true
+			//判断是否绑定手机号
+			phone := qutil.InterfaceToStr(this.GetSession("phone"))
+			if phone == "" {
+				//没有绑定手机号
+			} else {
+				isBinding = true
+				//绑定手机号
+				chatIdInt := gconv.Int64(encrypt.SE.Decode4HexByCheck(key))
+				data := public.Mysql.SelectBySql(`select  recipientUserPhone from vip_gift_records where  id =? `, chatIdInt)
+				if data != nil || len(*data) > 0 {
+					recipientUserPhone := gconv.String((*data)[0]["recipientUserPhone"])
+					log.Println("1111", recipientUserPhone, "222222222222", phone)
+					if recipientUserPhone == phone {
+						isSame = true
+					}
+				}
+			}
 		}
-		redirectUrl = fmt.Sprintf("/jy_mobile/giving/share?isSubscribe=%v&giftId=%s", isSubscribe, key)
+		redirectUrl = fmt.Sprintf("/jy_mobile/giving/share?isSubscribe=%v&isBinding=%v&isSame=%v&giftId=%s", isSubscribe, isBinding, isSame, key)
 	} else {
 		redirectUrl = "/swordfish/about"
 	}