|
@@ -81,18 +81,18 @@ func (this *WeChatController) SendTemplateMsg() {
|
|
|
break
|
|
|
}
|
|
|
}
|
|
|
- userList, err := models.GetUserBySubscribe()
|
|
|
- if err != nil {
|
|
|
- br.Msg = "获取用户列表失败"
|
|
|
- br.ErrMsg = "获取用户列表失败,Err:" + err.Error()
|
|
|
- return
|
|
|
- }
|
|
|
- userUnionMap := make(map[int]string)
|
|
|
- for _, v := range userList {
|
|
|
- userUnionMap[v.UserId] = v.UnionId
|
|
|
- }
|
|
|
var openIds []*services.OpenIdList
|
|
|
if IsPublic {
|
|
|
+ userList, err := models.GetUserBySubscribe()
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取用户列表失败"
|
|
|
+ br.ErrMsg = "获取用户列表失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ userUnionMap := make(map[int]string)
|
|
|
+ for _, v := range userList {
|
|
|
+ userUnionMap[v.UserId] = v.UnionId
|
|
|
+ }
|
|
|
var unionIds []string
|
|
|
for _, v := range userList {
|
|
|
unionIds = append(unionIds, v.UnionId)
|
|
@@ -113,6 +113,16 @@ func (this *WeChatController) SendTemplateMsg() {
|
|
|
} else {
|
|
|
// 给指定用户,发送模板消息
|
|
|
// 报告所属的二级品种分类
|
|
|
+ userList, err := models.GetUserBySubscribeAndFormatUser()
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取用户列表失败"
|
|
|
+ br.ErrMsg = "获取用户列表失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ userUnionMap := make(map[int]string)
|
|
|
+ for _, v := range userList {
|
|
|
+ userUnionMap[v.UserId] = v.UnionId
|
|
|
+ }
|
|
|
var permissionIds []int
|
|
|
for _, v := range reportChartPermissionIdStrs {
|
|
|
vv, _ := strconv.Atoi(v)
|