|
@@ -231,37 +231,9 @@ func (stm *WxTmplPush) getUserOpenIdAndWxPushState() error {
|
|
|
log.Println("======", stm.Config.Switch)
|
|
|
if pushSetMap := common.ObjToMap(uData["o_pushset"]); pushSetMap != nil && len(*pushSetMap) > 0 {
|
|
|
if pushKeyMap := common.ObjToMap((*pushSetMap)[stm.Config.Switch]); pushKeyMap != nil && len(*pushKeyMap) > 0 {
|
|
|
- switch stm.Config.Switch {
|
|
|
- case "o_msg_active", "o_msg_service", "o_msg_jyschool", "o_msg_privateletter", "o_msg_business", "o_msg_pending":
|
|
|
- registedate := common.Int64All(uData["l_registedate"])
|
|
|
- s_m_openid := common.InterfaceToStr(uData["s_m_openid"])
|
|
|
- ShowWx := false
|
|
|
- if s_m_openid != "" {
|
|
|
- //微信是否关注处理
|
|
|
- subscribeList := &[]map[string]interface{}{}
|
|
|
- subscribeList, _ = entity.MQFW.Find("jy_subscribe", map[string]interface{}{"s_m_openid": s_m_openid}, `{"l_date":-1}`, `{"s_event":1"}`, true, -1, -1)
|
|
|
- if subscribeList != nil && len(*subscribeList) > 0 {
|
|
|
- s_event := common.InterfaceToStr((*subscribeList)[0]["s_event"])
|
|
|
- if s_event == "subscribe" {
|
|
|
- ShowWx = true
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- if (*pushKeyMap)["i_wxpush"] != nil {
|
|
|
- if common.Int64All((*pushKeyMap)["i_wxpush"]) == 1 {
|
|
|
- return nil
|
|
|
- }
|
|
|
- } else {
|
|
|
- if registedate > config.ConfigJson.Registedate && ShowWx {
|
|
|
- return nil
|
|
|
- }
|
|
|
- }
|
|
|
- default:
|
|
|
- if common.Int64All((*pushKeyMap)["i_wxpush"]) == 1 {
|
|
|
- return nil
|
|
|
- }
|
|
|
+ if common.Int64All((*pushKeyMap)["i_wxpush"]) == 1 {
|
|
|
+ return nil
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
return fmt.Errorf("未开启推送设置")
|