浏览代码

Merge branch 'aj_broadcast'

hongze 1 月之前
父节点
当前提交
4b9acf2790
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 6 1
      services/voice_broadcast.go

+ 6 - 1
services/voice_broadcast.go

@@ -212,7 +212,7 @@ func SendBroadcastMsg(broadcastId, userId int) (errMsg string, err error) {
 	}
 	// 推送模板消息
 	go func() {
-		_ = wechat.SendVoiceBroadcastWxMsg(broadcast.BroadcastId,broadcast.VarietyId, broadcast.SectionName, broadcast.BroadcastName)
+		_ = wechat.SendVoiceBroadcastWxMsg(broadcast.BroadcastId, broadcast.VarietyId, broadcast.SectionName, broadcast.BroadcastName)
 	}()
 	// 推送客群消息
 	//go func() {
@@ -224,6 +224,11 @@ func SendBroadcastMsg(broadcastId, userId int) (errMsg string, err error) {
 // CreateVoiceBroadcast 新增语音播报
 func CreateVoiceBroadcast(sectionId, varietyId, authorId int, broadcastName, sectionName, varietyName, author, voiceSeconds, voiceSize, voiceUrl, imgs string, userInfo user.UserInfo) (resp response.Broadcast, err error) {
 	nowTime := time.Now().Local()
+	if userInfo.UserID > 0 {
+		authorId = int(userInfo.UserID)
+		author = userInfo.RealName
+	}
+
 	item := &voice_broadcast.VoiceBroadcast{
 		BroadcastName:    broadcastName,
 		SectionId:        sectionId,