Explorar o código

feat:获取聊天信息

wangshan hai 1 ano
pai
achega
3619ece857
Modificáronse 1 ficheiros con 11 adicións e 7 borrados
  1. 11 7
      service/message_mail_box.go

+ 11 - 7
service/message_mail_box.go

@@ -644,13 +644,17 @@ func UserSynchronousList(customerServiceId, userId, entId, messageId int64, crea
 				"message_id":              messageId,
 			})
 			//新增客服用户表
-			if ok > 0 && customerServiceId > 0 {
-				IC.BaseMysql.InsertByTx(tx, util.SOCIALIZE_CUSTOMER_SERVICE_USER, map[string]interface{}{
-					"user_id":             userId,
-					"ent_id":              entId,
-					"customer_service_id": customerServiceId,
-					"unread":              quitl.If(sendUserType == 1, 0, 1),
-				})
+			if ok > 0 {
+				if customerServiceId > 0 {
+					if id := IC.BaseMysql.InsertByTx(tx, util.SOCIALIZE_CUSTOMER_SERVICE_USER, map[string]interface{}{
+						"user_id":             userId,
+						"ent_id":              entId,
+						"customer_service_id": customerServiceId,
+						"unread":              quitl.If(sendUserType == 1, 0, 1),
+					}); id <= 0 {
+						return false
+					}
+				}
 			} else {
 				return false
 			}