Selaa lähdekoodia

历史消息记录sql修改

renjiaojiao 2 vuotta sitten
vanhempi
commit
1e9f1df0b6
2 muutettua tiedostoa jossa 10 lisäystä ja 9 poistoa
  1. 3 2
      .idea/workspace.xml
  2. 7 7
      service/message_mail_box.go

+ 3 - 2
.idea/workspace.xml

@@ -10,6 +10,7 @@
       <change beforePath="$PROJECT_DIR$/go.sum" beforeDir="false" afterPath="$PROJECT_DIR$/go.sum" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/rpc/messagecenter/logs/access.log" beforeDir="false" afterPath="$PROJECT_DIR$/rpc/messagecenter/logs/access.log" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/rpc/messagecenter/logs/error.log" beforeDir="false" afterPath="$PROJECT_DIR$/rpc/messagecenter/logs/error.log" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/service/message_mail_box.go" beforeDir="false" afterPath="$PROJECT_DIR$/service/message_mail_box.go" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -273,9 +274,9 @@
     <MESSAGE value="查看消息修改未读消息数量" />
     <MESSAGE value="未读消息数量sql修改" />
     <MESSAGE value="未读sql修改" />
-    <MESSAGE value="提交" />
     <MESSAGE value="历史聊天记录查询" />
-    <option name="LAST_COMMIT_MESSAGE" value="历史聊天记录查询" />
+    <MESSAGE value="提交" />
+    <option name="LAST_COMMIT_MESSAGE" value="提交" />
   </component>
   <component name="VgoProject">
     <integration-enabled>true</integration-enabled>

+ 7 - 7
service/message_mail_box.go

@@ -686,11 +686,11 @@ func (b MessaggeService) FindMessage(in *messagecenter.MessageReq) *[]map[string
 			"IF ( a.own_id = a.send_user_id, 0, a.send_user_id ) AS send_position_id,"+
 			"a.send_user_type,a.type AS itemType FROM %s a "+
 			"LEFT JOIN %s b ON a.messag_id = b.id "+
-			"WHERE a.own_type = 1 AND a.own_id = %d "+
-			"AND chat_group_id = %d AND a.type IN ( 3, 6 ) "+
+			"WHERE a.own_type = 2 AND a.own_id = %d "+
+			"AND a.chat_group_id = %d AND a.type IN ( 3, 6 ) "+
 			"ORDER BY a.create_time desc,a.id DESC "+
 			"LIMIT 0, %d",
-			util.SOCIALIZE_MESSAGE_MAILBOX, util.SOCIALIZE_MESSAGE, in.SendId,
+			util.SOCIALIZE_MESSAGE_MAILBOX, util.SOCIALIZE_MESSAGE, in.PositionId,
 			in.ChatGroupId, in.PageSize)
 	case 4, 5, 6, 7: //客服聊天
 		//查询用户所有的职位id
@@ -714,18 +714,18 @@ func (b MessaggeService) FindMessage(in *messagecenter.MessageReq) *[]map[string
 			sqlStr = fmt.Sprintf("SELECT a.messag_id as messageId,e.appraise as appraise, b.*,   IF ( a.own_id = a.send_user_id, 1, 2 ) AS fool ,   a.send_user_type,   a.type as  itemType,   d.nickname as  robotName,   d.headimage as  robotImg,   c.customer_service_name as  setName   "+
 				"FROM   %s a   "+
 				"LEFT JOIN %s b ON a.messag_id = b.id   "+
-				"LEFT JOIN %s c ON   IF  ( a.send_user_type = 1, a.send_user_id, a.receive_user_id ) = c.id AND  c.ent_id = %d AND c.user_id in (%s) "+
+				"LEFT JOIN %s c ON   IF  ( a.send_user_type = 1, a.send_user_id, a.receive_user_id ) = c.id  AND c.user_id in (%s) "+
 				"LEFT JOIN  %s d on  c.ent_id=d.ent_id  "+
 				"LEFT JOIN  %s e on  b.id=e.messag_id  "+
 				"WHERE   a.own_type = 2    "+
 				"AND a.own_id in  (%s) "+
-				"AND  c.ent_id = %d "+
+				//"AND  c.ent_id = %d "+
 				"AND c.user_id in  (%s) "+
 				"AND ( a.type = 4 OR a.type = 5 or a.type=6 or  a.type=7)  %s "+
 				"ORDER BY a.create_time desc ,a.id   asc "+
 				"limit 0 ,   %d ",
-				util.SOCIALIZE_MESSAGE_MAILBOX, util.SOCIALIZE_MESSAGE, util.SOCIALIZE_CHAT_SESSION, in.EntId, positionStr, util.SOCIALIZE_TENANT_ROBOT,
-				util.SOCIALIZE_APPRAISE, positionStr, in.EntId, positionStr, lastStr, in.PageSize)
+				util.SOCIALIZE_MESSAGE_MAILBOX, util.SOCIALIZE_MESSAGE, util.SOCIALIZE_CHAT_SESSION, positionStr, util.SOCIALIZE_TENANT_ROBOT,
+				util.SOCIALIZE_APPRAISE, positionStr, positionStr, lastStr, in.PageSize)
 		}
 		break
 	}