Ver código fonte

客服名称保存

WH01243 3 anos atrás
pai
commit
1870b3007f
1 arquivos alterados com 8 adições e 1 exclusões
  1. 8 1
      service/message_mail_box.go

+ 8 - 1
service/message_mail_box.go

@@ -318,6 +318,13 @@ func (b MessaggeService) FindMessage(in *messagecenter.MessageReq) (*[]map[strin
 }
 func (b MessaggeService) CreateChatSession(in *messagecenter.ChatSessionReq) (errorCode, sessionId int64) {
 	fool := Mysql.ExecTx("会话新建", func(tx *sql.Tx) bool {
+		customerserviceName := in.CustomerserviceName
+		if in.CustomerServiceId != 0 {
+			customerList := Mysql.SelectBySql("select  customer_service_name from  socialize_tenant_seat  where  ent_id=" + quitl.InterfaceToStr(in.EntId) + " and customer_service_id=" + quitl.InterfaceToStr(in.CustomerServiceId))
+			if len(*customerList) > 0 {
+				customerserviceName = quitl.InterfaceToStr((*customerList)[0]["customer_service_name"])
+			}
+		}
 		chatMession := map[string]interface{}{
 			"handle_status":         0,
 			"start_time":            time.Now().Local().Format(util.Date_Full_Layout),
@@ -325,7 +332,7 @@ func (b MessaggeService) CreateChatSession(in *messagecenter.ChatSessionReq) (er
 			"ent_id":                in.EntId,
 			"customer_service_id":   in.CustomerServiceId,
 			"user_id":               in.UserId,
-			"customer_service_name": in.CustomerserviceName,
+			"customer_service_name": customerserviceName,
 		}
 		sessionId = Mysql.InsertByTx(tx, "socialize_chat_session", chatMession)
 		return sessionId > 0