浏览代码

fix:模板消息推送的bug修复

Roc 7 月之前
父节点
当前提交
8decbd5b69
共有 2 个文件被更改,包括 3 次插入1 次删除
  1. 1 0
      controllers/report.go
  2. 2 1
      services/wechat_send_msg.go

+ 1 - 0
controllers/report.go

@@ -1909,6 +1909,7 @@ func (this *ReportController) SendMsg() {
 		return
 	}
 
+	fmt.Println("reportInfo.MsgIsSend :", reportInfo.MsgIsSend)
 	// 可能存在历史数据两个只推了一个所以此处加个判断
 	// 推送模板消息
 	if reportInfo.MsgIsSend == 0 {

+ 2 - 1
services/wechat_send_msg.go

@@ -16,6 +16,7 @@ import (
 
 // SendMiniProgramReportWxMsg 推送报告微信模板消息-小程序链接
 func SendMiniProgramReportWxMsg(reportId int) (err error) {
+	fmt.Println("推送模板消息1 services SendMsg:", reportId)
 	var msg string
 	reportIdStr := strconv.Itoa(reportId)
 	defer func() {
@@ -26,7 +27,7 @@ func SendMiniProgramReportWxMsg(reportId int) (err error) {
 			//go utils.SendEmail("SendMiniProgramReportWxMsg发送报告模版消息失败"+"【"+utils.APPNAME+"】"+"【"+utils.RunMode+"】"+time.Now().Format("2006-01-02 15:04:05"), "ReportId:"+reportIdStr+";"+msg+";Err:"+err.Error(), toUser)
 		}
 	}()
-	fmt.Println("推送模板消息 services SendMsg:", reportId)
+	fmt.Println("推送模板消息2 services SendMsg:", reportId)
 
 	report, err := models.GetReportByReportId(reportId)
 	if err != nil {