|
@@ -231,9 +231,24 @@ 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 {
|
|
|
- if common.Int64All((*pushKeyMap)["i_wxpush"]) == 1 {
|
|
|
- return nil
|
|
|
+ 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"])
|
|
|
+ if (*pushKeyMap)["i_wxpush"] != nil {
|
|
|
+ if common.Int64All((*pushKeyMap)["i_wxpush"]) == 1 {
|
|
|
+ return nil
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if registedate > config.ConfigJson.Registedate {
|
|
|
+ return nil
|
|
|
+ }
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ if common.Int64All((*pushKeyMap)["i_wxpush"]) == 1 {
|
|
|
+ return nil
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
return fmt.Errorf("未开启推送设置")
|
|
@@ -255,7 +270,7 @@ func (stm *WxTmplPush) GetUserPushInfo() map[string]interface{} {
|
|
|
}
|
|
|
}
|
|
|
if len(query) > 0 {
|
|
|
- rData, _ := entity.MQFW.FindOneByField("user", query, fmt.Sprintf(`{"s_m_openid":1,"s_opushid": 1, "s_jpushid": 1, "s_appponetype": 1, "s_appversion": 1,"o_pushset.%s":1}`, stm.Config.Switch))
|
|
|
+ rData, _ := entity.MQFW.FindOneByField("user", query, fmt.Sprintf(`{"l_registedate":1,"s_m_openid":1,"s_opushid": 1, "s_jpushid": 1, "s_appponetype": 1, "s_appversion": 1,"o_pushset.%s":1}`, stm.Config.Switch))
|
|
|
if rData != nil && len(*rData) > 0 {
|
|
|
return *rData
|
|
|
}
|