|
@@ -9,7 +9,6 @@ import (
|
|
|
"fmt"
|
|
|
"html"
|
|
|
"strconv"
|
|
|
- "time"
|
|
|
)
|
|
|
|
|
|
type WeChatController struct {
|
|
@@ -147,31 +146,13 @@ func (this *WeChatController) SendTemplateMsg() {
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
- sendMap := make(map[string]interface{})
|
|
|
- sendMap["template_id"] = utils.TEMPLATE_ID_BY_PRODUCT
|
|
|
- // sendMap["first"] = fmt.Sprintf("Hi,最新一期%s已上线,欢迎查看", report.ClassifyNameFirst)
|
|
|
- // sendMap["keyword1"] = map[string]interface{}{"value": fmt.Sprintf("弘则%s", report.ClassifyNameSecond), "color": "#173177"}
|
|
|
- // sendMap["keyword2"] = map[string]interface{}{"value": report.ContentSub, "color": "#173177"}
|
|
|
- sendMap["first"] = "测试first"
|
|
|
- sendMap["keyword1"] = "测试k1"
|
|
|
- sendMap["keyword2"] = "测试k2"
|
|
|
- sendMap["remark"] = time.Now().Format("2006-01-02")
|
|
|
- // sendMap["keyword3"] = map[string]interface{}{"value": report.PublishTime, "color": "#173177"}
|
|
|
- // sendMap["keyword4"] = map[string]interface{}{"value": report.Abstract, "color": "#173177"}
|
|
|
- var WxAppId = `wxb059c872d79b9967`
|
|
|
- // var WxAppSecret = `1737c73e9f69a21de1a345b8f0800258`
|
|
|
- var wxAppPath string
|
|
|
- if utils.RunMode == "debug" {
|
|
|
- wxAppPath = fmt.Sprintf("pages-question/answerDetail?id=%d", 3800)
|
|
|
- } else {
|
|
|
- wxAppPath = fmt.Sprintf("pages-report/reportDetail/index?id=%d", report.Id)
|
|
|
- }
|
|
|
- sendMap["miniprogram"] = map[string]string{
|
|
|
- "appid": WxAppId,
|
|
|
- "pagepath": wxAppPath,
|
|
|
- }
|
|
|
- alarm_msg.SendAlarmMsg(fmt.Sprintf("发送模板消息,报告id:%d", report.Id), 1)
|
|
|
- err = services.SendMultiTemplateMsg(sendMap, openIds, 1)
|
|
|
+ sendData := make(map[string]interface{})
|
|
|
+ sendData["first"] = fmt.Sprintf("Hi,最新一期%s已上线,欢迎查看", report.ClassifyNameFirst)
|
|
|
+ sendData["keyword1"] = map[string]interface{}{"value": fmt.Sprintf("弘则%s", report.ClassifyNameSecond), "color": "#173177"}
|
|
|
+ sendData["keyword2"] = map[string]interface{}{"value": report.ContentSub, "color": "#173177"}
|
|
|
+ sendData["keyword3"] = map[string]interface{}{"value": report.PublishTime, "color": "#173177"}
|
|
|
+ sendData["keyword4"] = map[string]interface{}{"value": report.Abstract, "color": "#173177"}
|
|
|
+ err = services.SendMultiTemplateMsg(sendData, openIds, 1, reportId)
|
|
|
if err != nil {
|
|
|
br.Msg = "发送失败"
|
|
|
br.ErrMsg = "发送失败,Err:" + err.Error()
|