Browse Source

日志打印

WH01243 2 years ago
parent
commit
912976b687
1 changed files with 6 additions and 2 deletions
  1. 6 2
      service/message_mail_box.go

+ 6 - 2
service/message_mail_box.go

@@ -504,6 +504,9 @@ func (b MessaggeService) SaveMessage(in *messagecenter.MessageEntity) (fool bool
 				messageMailBox["receive_user_id"] = in.ReceiveId
 				userType = 1
 				userId = in.ReceiveId
+				if in.ItemType == 4 {
+					messageMailBox["isread"] = 1
+				}
 			} else {
 				//客服发送(用户接收信息)
 				messageMailBox["own_type"] = 2
@@ -579,14 +582,14 @@ func (b MessaggeService) SaveMessage(in *messagecenter.MessageEntity) (fool bool
 		return ok > 1 && receiveOk > 1
 	})
 	if fool {
-		go UserSynchronousList(customer_service_id, userid, entid, message_id, create_time, quitl.Int64All(quitl.If(userType == 1, 2, 1)))
+		go UserSynchronousList(customer_service_id, userid, entid, message_id, create_time, quitl.Int64All(quitl.If(userType == 1, 2, 1)), in.ItemType)
 	}
 	return fool, "", in.Content, messageId, nowForm.Unix()
 }
 
 // 客服 用户聊天消息列表同步
 // sendUserType 发送人类型 1客服 2用户
-func UserSynchronousList(customerServiceId, userId, entId, messageId int64, createTime string, sendUserType int64) {
+func UserSynchronousList(customerServiceId, userId, entId, messageId int64, createTime string, sendUserType, itemType int64) {
 	log.Printf("同步最后消息参数customerServiceId:%d,userId:%d,entId%d,messageId:%d", customerServiceId, userId, entId, messageId)
 	/*	rwLock.Lock()
 		defer rwLock.Unlock()*/
@@ -601,6 +604,7 @@ func UserSynchronousList(customerServiceId, userId, entId, messageId int64, crea
 		} else {
 			customer_service_access = quitl.IntAll((*data)["customer_service_access"])
 		}
+		log.Println(customer_service_access, "customer_service_access打印", (*data)["customer_service_access"], customerServiceId, (*data)["customer_service_access"] == 0 && customerServiceId > 0)
 		//更新汇总表
 		ok := int64(0)
 		if sendUserType == 1 {