修复聊天记录问题

pull/23/head
taoshihan1991 4 years ago
parent 27f1a7bf4f
commit 00b6753948

@ -374,10 +374,10 @@ func GetMessagesV2(c *gin.Context) {
messages := models.FindMessageByVisitorId(visitorId)
//result := make([]map[string]interface{}, 0)
chatMessages := make([]ChatMessage, 0)
for _, message := range messages {
//item := make(map[string]interface{})
var visitor models.Visitor
var kefu models.User
for _, message := range messages {
//item := make(map[string]interface{})
if visitor.Name == "" || kefu.Name == "" {
kefu = models.FindUser(message.KefuId)
visitor = models.FindVisitorByVistorId(message.VisitorId)

@ -151,10 +151,10 @@ func GetVisitorMessage(c *gin.Context) {
visitorId := c.Query("visitorId")
messages := models.FindMessageByVisitorId(visitorId)
result := make([]map[string]interface{}, 0)
for _, message := range messages {
item := make(map[string]interface{})
var visitor models.Visitor
var kefu models.User
for _, message := range messages {
item := make(map[string]interface{})
if visitor.Name == "" || kefu.Name == "" {
kefu = models.FindUser(message.KefuId)
visitor = models.FindVisitorByVistorId(message.VisitorId)

Loading…
Cancel
Save