|
@@ -499,7 +499,9 @@ func saveUser(u *UserInfo, source, pre, RSource, CSource string) (bool, string,
|
|
|
}
|
|
|
if pre == "11" || pre == "12" || pre == "19" || pre == "17" { //11pc订阅,12pc搜索关键词
|
|
|
newUser, pcresult, subkey = pcSetUserKeys(newUser, source, pre)
|
|
|
- newUser["i_ts_guide"] = 1 //pc订阅关键词,不再走向导页
|
|
|
+ if subkey != "" {
|
|
|
+ newUser["i_ts_guide"] = 1 //pc订阅关键词,不再走向导页
|
|
|
+ }
|
|
|
}
|
|
|
//看是否有对应关系
|
|
|
fromkey := fmt.Sprintf("share_jyb_%s", u.OpenId)
|
|
@@ -1148,7 +1150,7 @@ func ScanHandler(w ResponseWriter, r *Request) {
|
|
|
|
|
|
}
|
|
|
//部分未关注用户通过点击菜单创建的用户 openid和unionid为空
|
|
|
- m, b := tools.MQFW.FindOneByField("user", `{"s_m_openid":"`+openid+`","s_unionid":{"$ne":"`+openid+`"}}`, `{"_id":1,"s_headimage":1,"o_jy":1,"o_vipjy":1,"i_vip_status":1}`)
|
|
|
+ m, b := tools.MQFW.FindOneByField("user", `{"s_m_openid":"`+openid+`","s_unionid":{"$ne":"`+openid+`"}}`, `{"_id":1,"s_headimage":1,"o_jy":1,"o_vipjy":1,"i_vip_status":1,"i_ts_guide":1}`)
|
|
|
if b {
|
|
|
//剑鱼标讯订阅提醒 (1:关注事件,2:扫码事件,3:发送客服消息处理,4:支付操作)
|
|
|
if openid != "" {
|
|
@@ -1230,15 +1232,20 @@ func ScanHandler(w ResponseWriter, r *Request) {
|
|
|
pcresult = "vipsubscribe##reply"
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
} else {
|
|
|
pcUser, pcresult, subkey = pcSetUserKeys(*m, r.EventKey, pccodepre)
|
|
|
+ i_ts_guide := util.IntAll((*m)["i_ts_guide"])
|
|
|
+ //有关键词 切是在订阅设置页面扫码 订阅向导未关闭(=2) 扫码订阅后 关闭订阅向导(=1)
|
|
|
+ if i_ts_guide == 0 || (i_ts_guide == 2 && subkey != "") {
|
|
|
+ i_ts_guide = 1
|
|
|
+ }
|
|
|
go tools.MQFW.Update("user", &map[string]interface{}{
|
|
|
"s_m_openid": openid,
|
|
|
"s_unionid": map[string]interface{}{"$ne": openid},
|
|
|
}, &map[string]interface{}{
|
|
|
"$set": map[string]interface{}{
|
|
|
- "o_jy": pcUser["o_jy"],
|
|
|
+ "o_jy": pcUser["o_jy"],
|
|
|
+ "i_ts_guide": i_ts_guide,
|
|
|
},
|
|
|
}, false, false)
|
|
|
}
|