|
@@ -86,7 +86,7 @@ func (m *msgRemind) PaySuccess(orderId int, orderCode, userId, prepayTime string
|
|
|
s_opushid, _ := (*user)["s_opushid"].(string)
|
|
|
s_appponetype, _ := (*user)["s_appponetype"].(string)
|
|
|
log.Println("支付成功,推送消息", userId, "s_m_openid", s_m_openid, "s_jpushid", s_jpushid, "s_opushid", s_opushid, "s_appponetype", s_appponetype)
|
|
|
- if isPushWx == 1 {
|
|
|
+ if isPushWx == 1 && s_m_openid != "" {
|
|
|
l_vip_endtime := (*user)["l_vip_endtime"]
|
|
|
expireTime := util.FormatDateWithObj(&l_vip_endtime, util.Date_Short_Layout)
|
|
|
wxPushOk, _ := qrpc.WxSendTmplMsg(Config.Weixinrpc, &qrpc.WxTmplMsg{
|
|
@@ -112,6 +112,18 @@ func (m *msgRemind) PaySuccess(orderId int, orderCode, userId, prepayTime string
|
|
|
Url: Config.WebDomain + "/front/sess/" + Se_Topnet.EncodeString(s_m_openid+",uid,"+strconv.Itoa(int(time.Now().Unix()))+",msgremind") + "__" + hex.EncodeToString([]byte(fmt.Sprintf("type=paid"))),
|
|
|
})
|
|
|
log.Println("支付成功,微信推送", userId, wxPushOk)
|
|
|
+ } else if s_opushid != "" || s_jpushid != "" {
|
|
|
+ appPushOk := qrpc.AppPush(Config.Apppushrpc, map[string]interface{}{
|
|
|
+ "phoneType": s_appponetype,
|
|
|
+ "otherPushId": s_opushid,
|
|
|
+ "jgPushId": s_jpushid,
|
|
|
+ "url": Config.WebDomain + "/jyapp/free/sess/" + Se_Topnet.EncodeString(userId+",uid,"+strconv.Itoa(int(time.Now().Unix()))+",msgremind") + "__" + hex.EncodeToString([]byte(fmt.Sprintf("type=paid"))),
|
|
|
+ "userId": userId,
|
|
|
+ "type": "feedback",
|
|
|
+ "descript": fmt.Sprintf(MessageConfig.WxTpl_PaySuccess.First.Value, orderCode),
|
|
|
+ "title": "剑鱼提醒",
|
|
|
+ })
|
|
|
+ log.Println("支付成功,app推送", userId, appPushOk)
|
|
|
}
|
|
|
}()
|
|
|
}
|
|
@@ -171,7 +183,7 @@ func (m *msgRemind) run() {
|
|
|
s_appponetype, _ := (*user)["s_appponetype"].(string)
|
|
|
log.Println("未支付订单,推送消息", unpaidOrder.userId, "remind_status", remind_status, "i_ispush", isPushWx, "s_m_openid", s_m_openid, "s_jpushid", s_jpushid, "s_opushid", s_opushid, "s_appponetype", s_appponetype)
|
|
|
wxPushOk, appPushOk := false, false
|
|
|
- if isPushWx == 1 {
|
|
|
+ if isPushWx == 1 && s_m_openid != "" {
|
|
|
tmplData := map[string]*qrpc.TmplItem{
|
|
|
"first": &qrpc.TmplItem{
|
|
|
Value: fmt.Sprintf(MessageConfig.WxTpl_Unpaid.First.Value, unpaidOrder.orderCode),
|
|
@@ -202,6 +214,18 @@ func (m *msgRemind) run() {
|
|
|
Url: Config.WebDomain + "/front/sess/" + Se_Topnet.EncodeString(s_m_openid+",uid,"+strconv.Itoa(int(time.Now().Unix()))+",msgremind") + "__" + hex.EncodeToString([]byte(fmt.Sprintf("type=unpaid&ordercode=%s", unpaidOrder.orderCode))),
|
|
|
})
|
|
|
log.Println("未支付订单,微信推送", unpaidOrder.userId, wxPushOk)
|
|
|
+ } else if s_opushid != "" || s_jpushid != "" {
|
|
|
+ appPushOk = qrpc.AppPush(Config.Apppushrpc, map[string]interface{}{
|
|
|
+ "phoneType": s_appponetype,
|
|
|
+ "otherPushId": s_opushid,
|
|
|
+ "jgPushId": s_jpushid,
|
|
|
+ "url": Config.WebDomain + "/jyapp/free/sess/" + Se_Topnet.EncodeString(unpaidOrder.userId+",uid,"+strconv.Itoa(int(time.Now().Unix()))+",msgremind") + "__" + hex.EncodeToString([]byte(fmt.Sprintf("type=unpaid&ordercode=%s", unpaidOrder.orderCode))),
|
|
|
+ "userId": unpaidOrder.userId,
|
|
|
+ "type": "feedback",
|
|
|
+ "descript": fmt.Sprintf(MessageConfig.WxTpl_Unpaid.First.Value, unpaidOrder.orderCode),
|
|
|
+ "title": "剑鱼提醒",
|
|
|
+ })
|
|
|
+ log.Println("未支付订单,app推送", unpaidOrder.userId, appPushOk)
|
|
|
}
|
|
|
if wxPushOk || appPushOk {
|
|
|
if remind_status == 2 {
|