|
@@ -320,7 +320,7 @@ func SendQuestionReplyWxMsg(questionId, userId int, questionTitle string) (err e
|
|
}
|
|
}
|
|
|
|
|
|
// SendVoiceBroadcastWxMsg 推送研报小程序模板消息-语音播报
|
|
// SendVoiceBroadcastWxMsg 推送研报小程序模板消息-语音播报
|
|
-func SendVoiceBroadcastWxMsg(broadcastId int, sectionName, broadcastName string) (err error) {
|
|
|
|
|
|
+func SendVoiceBroadcastWxMsg(broadcastId,varietyId int, sectionName, broadcastName string) (err error) {
|
|
var errMsg string
|
|
var errMsg string
|
|
defer func() {
|
|
defer func() {
|
|
if err != nil {
|
|
if err != nil {
|
|
@@ -329,17 +329,19 @@ func SendVoiceBroadcastWxMsg(broadcastId int, sectionName, broadcastName string)
|
|
}
|
|
}
|
|
}()
|
|
}()
|
|
|
|
|
|
- List, err := wx_user.GetOpenIdList()
|
|
|
|
- if err != nil {
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- openIdList := make([]*OpenIdList, 0)
|
|
|
|
- for _, item := range List {
|
|
|
|
- openIdList = append(openIdList, &OpenIdList{
|
|
|
|
- OpenId: item.OpenID,
|
|
|
|
- UserId: item.UserID,
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
|
|
+ openIdArr,err:=wx_user.GetOpenIdArrByVarietyTag(varietyId)
|
|
|
|
+
|
|
|
|
+ //List, err := wx_user.GetOpenIdList()
|
|
|
|
+ //if err != nil {
|
|
|
|
+ // return
|
|
|
|
+ //}
|
|
|
|
+ //openIdList := make([]*OpenIdList, 0)
|
|
|
|
+ //for _, item := range List {
|
|
|
|
+ // openIdList = append(openIdList, &OpenIdList{
|
|
|
|
+ // OpenId: item.OpenID,
|
|
|
|
+ // UserId: item.UserID,
|
|
|
|
+ // })
|
|
|
|
+ //}
|
|
//openIdList = append(openIdList, &OpenIdList{
|
|
//openIdList = append(openIdList, &OpenIdList{
|
|
// OpenId: "oN0jD1cuiBLxV1IRpu74_oHnoOjk",
|
|
// OpenId: "oN0jD1cuiBLxV1IRpu74_oHnoOjk",
|
|
// UserId: 52709,
|
|
// UserId: 52709,
|
|
@@ -370,10 +372,10 @@ func SendVoiceBroadcastWxMsg(broadcastId int, sectionName, broadcastName string)
|
|
//}
|
|
//}
|
|
//err = SendMultiTemplateMsgNoReturn(sendMap, openIdList, wxAppPath, utils.TEMPLATE_MSG_YB_VOICE_BROADCAST)
|
|
//err = SendMultiTemplateMsgNoReturn(sendMap, openIdList, wxAppPath, utils.TEMPLATE_MSG_YB_VOICE_BROADCAST)
|
|
|
|
|
|
- openIdArr := make([]string, len(openIdList))
|
|
|
|
- for i, v := range openIdList {
|
|
|
|
- openIdArr[i] = v.OpenId
|
|
|
|
- }
|
|
|
|
|
|
+ //openIdArr := make([]string, len(openIdList))
|
|
|
|
+ //for i, v := range openIdList {
|
|
|
|
+ // openIdArr[i] = v.OpenId
|
|
|
|
+ //}
|
|
|
|
|
|
// 获取小程序配置
|
|
// 获取小程序配置
|
|
appConf, err := wx_app.GetWxAppConf()
|
|
appConf, err := wx_app.GetWxAppConf()
|
|
@@ -381,6 +383,10 @@ func SendVoiceBroadcastWxMsg(broadcastId int, sectionName, broadcastName string)
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ //openIdArr := make([]string, len(openIdList))
|
|
|
|
+ //for i, v := range openIdList {
|
|
|
|
+ // openIdArr[i] = v.OpenId
|
|
|
|
+ //}
|
|
sendInfo := new(SendWxTemplate)
|
|
sendInfo := new(SendWxTemplate)
|
|
sendInfo.WxAppId = WxAppId
|
|
sendInfo.WxAppId = WxAppId
|
|
sendInfo.First = first
|
|
sendInfo.First = first
|