WH01243 3 anni fa
parent
commit
fcb5eefde2
1 ha cambiato i file con 5 aggiunte e 5 eliminazioni
  1. 5 5
      service/message_mail_box.go

+ 5 - 5
service/message_mail_box.go

@@ -370,20 +370,20 @@ func (m *MessaggeService) SaveAutoReplyMsg(userType, entId, entUserId, userId in
 	return Mysql.ExecTx("保存自动回复消息", func(tx *sql.Tx) bool {
 		entUserName := ""
 		if entUserId > 0 {
-			list := Mysql.SelectBySql(`select customer_service_name from socialize_tenant_seat where appid=? and ent_id=? and customer_service_id=?`, m.AppId, entId, entUserId)
+			list := Mysql.SelectBySql(`select customer_service_name from socialize_tenant_seat where appid=? and ent_id=? and customer_service_id=?`, appId, entId, entUserId)
 			if list != nil && len(*list) > 0 {
 				entUserName, _ = (*list)[0]["customer_service_name"].(string)
 			}
 		}
-		messageId := Mysql.InsertBySqlByTx(tx, `insert into socialize_message (appid,content,item,type,create_time,create_person) values (?,?,?,?,?,?)`, m.AppId, content, 8, 1, nowFormat, "admin")
-		sessionId := Mysql.InsertBySqlByTx(tx, `insert into socialize_chat_session (appid,type,ent_id,customer_service_id,customer_service_name,user_id,start_time,end_time) values (?,?,?,?,?,?,?,?)`, m.AppId, 1, entId, entUserId, entUserName, userId, nowFormat, nowFormat)
+		messageId := Mysql.InsertBySqlByTx(tx, `insert into socialize_message (appid,content,item,type,create_time,create_person) values (?,?,?,?,?,?)`, appId, content, 8, 1, nowFormat, "admin")
+		sessionId := Mysql.InsertBySqlByTx(tx, `insert into socialize_chat_session (appid,type,ent_id,customer_service_id,customer_service_name,user_id,start_time,end_time) values (?,?,?,?,?,?,?,?)`, appId, 1, entId, entUserId, entUserName, userId, nowFormat, nowFormat)
 		ok := false
 		if userType == 1 {
-			if Mysql.InsertBySqlByTx(tx, `insert into socialize_message_mailbox (appid,messag_id,type,send_user_id,send_user_type,receive_user_id,receive_user_type,own_id,own_type,create_time) values (?,?,?,?,?,?,?,?,?,?)`, m.AppId, messageId, 7, sessionId, 1, userId, 2, sessionId, 1, nowFormat) > 0 {
+			if Mysql.InsertBySqlByTx(tx, `insert into socialize_message_mailbox (appid,messag_id,type,send_user_id,send_user_type,receive_user_id,receive_user_type,own_id,own_type,create_time) values (?,?,?,?,?,?,?,?,?,?)`, appId, messageId, 7, sessionId, 1, userId, 2, sessionId, 1, nowFormat) > 0 {
 				ok = true
 			}
 		} else if userType == 2 {
-			if Mysql.InsertBySqlByTx(tx, `insert into socialize_message_mailbox (appid,messag_id,type,send_user_id,send_user_type,receive_user_id,receive_user_type,own_id,own_type,create_time) values (?,?,?,?,?,?,?,?,?,?)`, m.AppId, messageId, 7, sessionId, 1, userId, 2, userId, 2, nowFormat) > 0 {
+			if Mysql.InsertBySqlByTx(tx, `insert into socialize_message_mailbox (appid,messag_id,type,send_user_id,send_user_type,receive_user_id,receive_user_type,own_id,own_type,create_time) values (?,?,?,?,?,?,?,?,?,?)`, appId, messageId, 7, sessionId, 1, userId, 2, userId, 2, nowFormat) > 0 {
 				ok = true
 			}
 		}