|
|
@@ -7,6 +7,7 @@ import (
|
|
|
"fmt"
|
|
|
"github.com/gogf/gf/frame/g"
|
|
|
"github.com/gogf/gf/util/gconv"
|
|
|
+ "strings"
|
|
|
|
|
|
"dashoo.cn/micro/app/dao/plat"
|
|
|
model "dashoo.cn/micro/app/model/plat"
|
|
|
@@ -70,21 +71,23 @@ func (s *followupCommentService) Create(req *model.AddPlatFollowupCommentReq) (e
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- // 从配置中获取消息提醒设置
|
|
|
- config, err := g.DB(s.Tenant).Model("sys_config").Where("config_key = 'SalesAssociate'").One()
|
|
|
+ // 从配置中获取消息提醒设置 销售总监、销售助理
|
|
|
+ configs, err := g.DB(s.Tenant).Model("sys_config").Where("config_key IN ('SalesDirector','SalesAssociate')").FindAll()
|
|
|
if err != nil && err != sql.ErrNoRows {
|
|
|
g.Log().Error(err)
|
|
|
return
|
|
|
}
|
|
|
- // 销售助理用户Id
|
|
|
- salesAssociate := config["config_value"].String()
|
|
|
- recvUserIds := salesAssociate + "," + gconv.String(followup.CreatedBy)
|
|
|
+ var recvUserIds []string
|
|
|
+ for _, config := range configs {
|
|
|
+ recvUserIds = append(recvUserIds, strings.Split(config["config_value"].String(), ",")...)
|
|
|
+ }
|
|
|
+ recvUserIds = append(recvUserIds, gconv.String(followup.CreatedBy))
|
|
|
|
|
|
msg := g.MapStrStr{
|
|
|
"msgTitle": "跟进记录评论提醒",
|
|
|
"msgContent": fmt.Sprintf("%v %v 评论:%v", followup.TargetName, platFollowupComment.CreatedName, platFollowupComment.Content),
|
|
|
"msgType": "20",
|
|
|
- "recvUserIds": recvUserIds,
|
|
|
+ "recvUserIds": strings.Join(recvUserIds, ","),
|
|
|
"msgStatus": "10",
|
|
|
"sendType": "30",
|
|
|
}
|