Browse Source

fix 模板消息异常 程序挂掉

zhangxinlei1996 3 years ago
parent
commit
cf1012b3e4
1 changed files with 4 additions and 0 deletions
  1. 4 0
      src/jfw/modules/subscribepay/src/entity/dataReportStruct.go

+ 4 - 0
src/jfw/modules/subscribepay/src/entity/dataReportStruct.go

@@ -170,6 +170,10 @@ func sendtemp(openid, order_coded, product_type, pay_time string) {
 	} else {
 	} else {
 		util.DataReport_WTMCS.Reload()
 		util.DataReport_WTMCS.Reload()
 		wtmc := util.DataReport_WTMCS.Get(config.MessageConfig.WxTpl_DataReport.First.Value)
 		wtmc := util.DataReport_WTMCS.Get(config.MessageConfig.WxTpl_DataReport.First.Value)
+		if wtmc == nil {
+			fmt.Println("数据报告模板参数异常")
+			return
+		}
 		ok, status := frpc.WxPush(config.Config.Weixinrpc, "WeiXinRpc.SendDataReportMsg", &frpc.NotifyMsg{
 		ok, status := frpc.WxPush(config.Config.Weixinrpc, "WeiXinRpc.SendDataReportMsg", &frpc.NotifyMsg{
 			Openid:  openid,
 			Openid:  openid,
 			Title:   wtmc.FirstData,
 			Title:   wtmc.FirstData,