|
@@ -77,10 +77,10 @@ func pushMsg(openid, text string) error {
|
|
|
return e
|
|
|
}
|
|
|
client, err := rpc.DialHTTP("tcp", conf.MSysConfig.Weixinrpc)
|
|
|
+ defer client.Close()
|
|
|
if err != nil {
|
|
|
return err
|
|
|
}
|
|
|
- defer client.Close()
|
|
|
var repl string
|
|
|
err = client.Call("WeiXinRpc.SendCustomMsg", param, &repl)
|
|
|
if err != nil {
|
|
@@ -91,13 +91,15 @@ func pushMsg(openid, text string) error {
|
|
|
|
|
|
//查询用户是否设置关键词和是否开通微信推送
|
|
|
func getUserStates(openid string) (hasKey, apply bool, registedate int64) {
|
|
|
- uMsg := mongodb.FindOneByField("user", map[string]interface{}{"s_m_openid": openid}, `{"i_applystatus":1,"o_jy":1,"l_registedate":1}`)
|
|
|
+ uMsg := mongodb.FindOneByField("user", map[string]interface{}{"s_m_openid": openid}, `{"i_applystatus":1,"o_jy":1,"i_vip_status":1,"l_registedate":1}`)
|
|
|
if uMsg != nil && len(*uMsg) > 0 {
|
|
|
if util.IntAll((*uMsg)["i_applystatus"]) == 1 {
|
|
|
apply = true
|
|
|
}
|
|
|
o_jy := util.ObjToMap((*uMsg)["o_jy"])
|
|
|
- if (*o_jy)["a_key"] != nil && len((*o_jy)["a_key"].([]interface{})) > 0 {
|
|
|
+ i_vip_status := util.IntAll((*uMsg)["i_vip_status"])
|
|
|
+ //非VIP用户推送此提醒
|
|
|
+ if ((*o_jy)["a_key"] != nil && len((*o_jy)["a_key"].([]interface{})) > 0) || i_vip_status == 1 || i_vip_status == 2 {
|
|
|
hasKey = true
|
|
|
}
|
|
|
if (*uMsg)["l_registedate"] != nil {
|