wcj %!s(int64=6) %!d(string=hai) anos
pai
achega
3cc25d5f07
Modificáronse 1 ficheiros con 14 adicións e 1 borrados
  1. 14 1
      src/jfw/modules/app/src/app/front/login.go

+ 14 - 1
src/jfw/modules/app/src/app/front/login.go

@@ -479,9 +479,20 @@ func (l *Login) WxLogin() {
 				(*user)["a_m_openid"] = u.OpenId
 				update := map[string]interface{}{
 					"$unset": map[string]interface{}{
-						"o_jy.i_mode": 1,
+						"o_jy.i_mode": "",
 					},
 				}
+				o_jy, _ := (*user)["o_jy"].(map[string]interface{})
+				i_mode := qutil.IntAll(o_jy["i_mode"])
+				wxpush, mailpush := 0, 0
+				if i_mode == 2 {
+					mailpush = 1
+				} else if i_mode == 3 {
+					wxpush = 1
+					mailpush = 1
+				} else {
+					wxpush = 1
+				}
 				set := map[string]interface{}{
 					"s_name":          u.Nickname,
 					"s_nickname":      u.Nickname,
@@ -493,6 +504,8 @@ func (l *Login) WxLogin() {
 					"a_m_openid":      u.OpenId,
 					"o_jy.i_apppush":  1,
 					"l_a_registedate": time.Now().Unix(),
+					"o_jy.i_wxpush":   wxpush,
+					"o_jy.i_mailpush": mailpush,
 				}
 				if (*user)["a_mergeorder"] == nil {
 					set["a_mergeorder"] = []string{"s_m_openid", "a_m_openid"}