瀏覽代碼

fix:模板记录

zqbao 9 月之前
父節點
當前提交
b1c7d7c10c
共有 2 個文件被更改,包括 7 次插入5 次删除
  1. 3 3
      models/user_template_record.go
  2. 4 2
      services/template_msg.go

+ 3 - 3
models/user_template_record.go

@@ -3,9 +3,9 @@ package models
 import "github.com/beego/beego/v2/client/orm"
 
 type UserTemplateRecord struct {
-	ID         int    `orm:"pk" description:"id"`
-	UserID     int    `description:"用户id"`
-	OpenID     string `description:"用户openid"`
+	Id         int    `orm:"pk" description:"id"`
+	UserId     int    `description:"用户id"`
+	OpenId     string `description:"用户openid"`
 	SendData   string `description:"发送内容"`
 	Result     string `description:"响应结果"`
 	CreateDate string `description:"创建日期"`

+ 4 - 2
services/template_msg.go

@@ -121,8 +121,8 @@ func (c *TemplateMsgSendClient) SendMsg() (sendRes *SendTemplateResponse, err er
 // AddUserTemplateRecord 新增模板消息推送记录
 func AddUserTemplateRecord(userId, sendStatus, sendType int, openid, sendData, result string) (err error) {
 	item := &models.UserTemplateRecord{
-		UserID:     userId,
-		OpenID:     openid,
+		UserId:     userId,
+		OpenId:     openid,
 		SendData:   sendData,
 		Result:     result,
 		CreateDate: time.Now().Format(utils.FormatDate),
@@ -144,6 +144,8 @@ func SendMultiTemplateMsg(sendData map[string]interface{}, items []*OpenIdList,
 	}
 
 	var WxAppId = `wxb059c872d79b9967` // 研报小程序appid
+	// var WxAppId = `wx9b5d7291e581233a`
+	// var WxAppSecret = `1737c73e9f69a21de1a345b8f0800258`
 	var wxAppPath string
 	if utils.RunMode == "debug" {
 		wxAppPath = fmt.Sprintf("pages-question/answerDetail?id=%d", 3800)