|
@@ -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
|