Procházet zdrojové kódy

Merge branch 'aj_broadcast'

hongze před 1 měsícem
rodič
revize
4b9acf2790
1 změnil soubory, kde provedl 6 přidání a 1 odebrání
  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() {
 	go func() {
-		_ = wechat.SendVoiceBroadcastWxMsg(broadcast.BroadcastId,broadcast.VarietyId, broadcast.SectionName, broadcast.BroadcastName)
+		_ = wechat.SendVoiceBroadcastWxMsg(broadcast.BroadcastId, broadcast.VarietyId, broadcast.SectionName, broadcast.BroadcastName)
 	}()
 	}()
 	// 推送客群消息
 	// 推送客群消息
 	//go func() {
 	//go func() {
@@ -224,6 +224,11 @@ func SendBroadcastMsg(broadcastId, userId int) (errMsg string, err error) {
 // CreateVoiceBroadcast 新增语音播报
 // CreateVoiceBroadcast 新增语音播报
 func CreateVoiceBroadcast(sectionId, varietyId, authorId int, broadcastName, sectionName, varietyName, author, voiceSeconds, voiceSize, voiceUrl, imgs string, userInfo user.UserInfo) (resp response.Broadcast, err error) {
 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()
 	nowTime := time.Now().Local()
+	if userInfo.UserID > 0 {
+		authorId = int(userInfo.UserID)
+		author = userInfo.RealName
+	}
+
 	item := &voice_broadcast.VoiceBroadcast{
 	item := &voice_broadcast.VoiceBroadcast{
 		BroadcastName:    broadcastName,
 		BroadcastName:    broadcastName,
 		SectionId:        sectionId,
 		SectionId:        sectionId,