|
@@ -33,8 +33,8 @@ func (w *ExhibitionStruct) GetExhibitionActiveHref(email, phone, source string,
|
|
|
}
|
|
|
//是否需要账号合并--未绑定手机号
|
|
|
var (
|
|
|
- mgoUserId = session.Get("mgoUserId").(string)
|
|
|
- token = ""
|
|
|
+ mgoUserId, _ = session.Get("mgoUserId").(string)
|
|
|
+ token = ""
|
|
|
)
|
|
|
//phone 绑定此手机号
|
|
|
if thisPhone, _ := session.Get("phone").(string); thisPhone == "" {
|
|
@@ -44,6 +44,20 @@ func (w *ExhibitionStruct) GetExhibitionActiveHref(email, phone, source string,
|
|
|
fmt.Println(phone, "------")
|
|
|
//留资福利 及 留资后跳转地址
|
|
|
if res := w.ExhibitionActive("", source, session, "second_ad_code,guide_page,welfare_type,welfare_content"); res != nil {
|
|
|
+ //供 文库 获取福利 使用
|
|
|
+ go func() {
|
|
|
+ key := fmt.Sprintf("exhibition_active_%s", mgoUserId)
|
|
|
+ if redis.Incr("newother", key) == 1 {
|
|
|
+ _ = redis.SetExpire("newother", key, Sysconfig.ExhibitionTimeOut)
|
|
|
+ err := jy.Publish(Mgo_Log, Sysconfig.Nsq, Sysconfig.NsqTopic, jy.Jywx_exhibition_active, mgoUserId, jy.Jywx_node1, map[string]interface{}{
|
|
|
+ "welfareType": res["welfare_type"],
|
|
|
+ "welfareContent": res["welfare_content"],
|
|
|
+ })
|
|
|
+ if err != nil {
|
|
|
+ log.Println("nsq队列写入失败-->", "jy_docs_exhibition_active", mgoUserId)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }()
|
|
|
href = util.ObjToString(res["toDirect"])
|
|
|
}
|
|
|
if token != "" {
|
|
@@ -63,13 +77,13 @@ func (w *ExhibitionStruct) ExhibitionActive(host, source string, session *httpse
|
|
|
switch {
|
|
|
case strings.Contains("first_ad_code", params):
|
|
|
res["bindOrNot"] = false
|
|
|
- if session.Get("phone") == "" {
|
|
|
+ if phone, _ := session.Get("phone").(string); phone == "" {
|
|
|
res["bindOrNot"] = true
|
|
|
}
|
|
|
res["adList"] = w.GetJyAdList(host, util.ObjToString(activeInfo["first_ad_code"]))
|
|
|
case strings.Contains("second_ad_code", params):
|
|
|
- //福利
|
|
|
- go ExhibitionWelfare(session, util.Int64All(activeInfo["welfare_type"]), util.ObjToString(activeInfo["welfare_content"]))
|
|
|
+ //福利--因 go-zero 版本不同,无法直接调 文库中台,改为前端直接调文库服务
|
|
|
+ //go ExhibitionWelfare(session, util.Int64All(activeInfo["welfare_type"]), util.ObjToString(activeInfo["welfare_content"]))
|
|
|
res["toDirect"] = fmt.Sprintf("%s?ad=%s", util.ObjToString("guide_page"), util.ObjToString("second_ad_code"))
|
|
|
}
|
|
|
}
|