Browse Source

问答音频点击日志增加姓名

xiexiaoyuan 2 years ago
parent
commit
36d82a09b1

+ 1 - 0
models/tables/yb_community_audio_listen_log/entity.go

@@ -14,6 +14,7 @@ type YbCommunityAudioListenLog struct {
 	SellerID                 int       `gorm:"column:seller_id;type:int(11)" json:"sellerId"`
 	SourceAgent              int       `gorm:"column:source_agent;type:tinyint(4);default:1" json:"source_agent"`             // 操作来源,1:小程序,2:小程序 pc 3:弘则研究公众号,4:web pc
 	CreateTime               time.Time `gorm:"column:create_time;type:datetime;default:CURRENT_TIMESTAMP" json:"create_time"` // 创建日志时间
+	RealName                 string    `gorm:"column:real_name;type:varchar(100);not null;default:''" json:"real_name"`                //用户姓名
 }
 
 // TableName get sql table name.获取数据库表名

+ 4 - 1
services/community/question.go

@@ -483,19 +483,22 @@ func AddAudioListenLog(userInfo user.UserInfo, audioId int, sourceAgent int) (er
 	}
 	companyName := "潜在客户"
 	companyStatus := "潜在"
+	sellerId := 0
 	if companyInfo != nil && companyInfo.CompanyID > 0 {
 		companyName = companyInfo.CompanyName
 		companyStatus = companyInfo.Status
+		sellerId = companyInfo.SellerID
 	}
 	//3. 添加点击日志
 	item := &yb_community_audio_listen_log.YbCommunityAudioListenLog{
 		CommunityQuestionAudioID: audio.CommunityQuestionAudioID,
 		CommunityQuestionID:      audio.CommunityQuestionID,
 		UserID:                   int(userInfo.UserID),
+		RealName:                 userInfo.RealName,
 		CompanyID:                int(userInfo.CompanyID),
 		CompanyName:              companyName,
 		CompanyStatus:            companyStatus,
-		SellerID:                 companyInfo.SellerID,
+		SellerID:                 sellerId,
 		SourceAgent:              sourceAgent,
 	}
 	if err = item.Create(); err != nil {