소스 검색

二维码地址跳转

WH01243 4 달 전
부모
커밋
85a468db31
2개의 변경된 파일18개의 추가작업 그리고 24개의 파일을 삭제
  1. 3 24
      src/jfw/front/singleLogin.go
  2. 15 0
      src/jfw/modules/subscribepay/src/service/vipGift.go

+ 3 - 24
src/jfw/front/singleLogin.go

@@ -46,10 +46,7 @@ const (
 func (this *SingleLogin) VipGiftUrl(key string) error {
 	var redirectUrl = ""
 	isSubscribe := false
-	isBinding := false
-	isSame := false
-	chatIdInt := gconv.Int64(encrypt.SE.Decode4HexByCheck(key))
-
+    chatIdInt := gconv.Int64(encrypt.SE.Decode4HexByCheck(key))
 	isWxB := public.CheckWxBrowser(this.Request)
 	sess := this.Session().GetMultiple()
 	userId, _ := sess["userId"].(string)
@@ -73,7 +70,6 @@ func (this *SingleLogin) VipGiftUrl(key string) error {
 			return this.Redirect(fmt.Sprintf(config.Wxoauth, url.QueryEscape(this.Site()+this.Url()), "wx"), 302)
 		}
 	}
-
 	if key != "" && chatIdInt > 0 {
 		openid = qutil.InterfaceToStr(this.GetSession("s_m_openid"))
 		//查看是否关注公众号
@@ -81,25 +77,8 @@ func (this *SingleLogin) VipGiftUrl(key string) error {
 		if openid == "" || (openid != "" && !CheckUserIsSubscribe(openid)) {
 			//没有关注  跳转关注页面
 		} 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&isBinding=%v&isSame=%v&giftId=%s", isSubscribe, isBinding, isSame, key)
 	} else {
 		redirectUrl = "/swordfish/about"

+ 15 - 0
src/jfw/modules/subscribepay/src/service/vipGift.go

@@ -117,6 +117,21 @@ func (t *VipGift) InformInfo() {
 		(*data)["giftUserPhone"] = string(giftUserPhone[0:3]) + "****" + string(giftUserPhone[len(giftUserPhone)-4:])
 		(*data)["urlLink"] = fmt.Sprintf("%s/vipGiftUrl/%s", config.Config.WebDomain, giftId)
 		(*data)["qRCodeLink"] = fmt.Sprintf("%s/qr?url=/vipGiftUrl/%s", config.Config.WebDomain, giftId)
+		isBinding := false
+		isSame := false
+		//判断是否绑定手机号
+		phone := qutil.InterfaceToStr(t.GetSession("phone"))
+		if phone == "" {
+			//没有绑定手机号
+		} else {
+			isBinding = true
+			recipientUserPhone := gconv.String((*data)["recipientUserPhone"])
+			if recipientUserPhone == phone {
+				isSame = true
+			}
+		}
+		(*data)["isBinding"] = isBinding
+		(*data)["isSame"] = isSame
 	}
 	t.ServeJson(NewResult(data, nil))
 }