|
@@ -625,7 +625,7 @@ func (b MessaggeService) FindMessage(in *messagecenter.MessageReq) *[]map[string
|
|
|
}
|
|
|
switch in.MsgType {
|
|
|
case 2: //点对点聊天
|
|
|
- sqlStr = fmt.Sprintf("SELECT a.messag_id as messageId,b.* ,if(a.own_id = a.send_user_id,1,2) as fool "+
|
|
|
+ sqlStr = fmt.Sprintf("SELECT a.messag_id as messageId,a.send_user_type,a.type AS itemType,b.* ,if(a.own_id = a.send_user_id,1,2) as fool "+
|
|
|
"FROM %s a "+
|
|
|
"LEFT JOIN %s b on a.messag_id=b.id "+
|
|
|
"LEFT JOIN %s c on c.id=a.send_user_id "+
|
|
@@ -638,17 +638,17 @@ func (b MessaggeService) FindMessage(in *messagecenter.MessageReq) *[]map[string
|
|
|
"ORDER BY a.create_time desc,a.id asc "+
|
|
|
"limit 0 , %d ",
|
|
|
util.SOCIALIZE_MESSAGE_MAILBOX, util.SOCIALIZE_MESSAGE, util.BASE_USER, util.BASE_USER,
|
|
|
- in.PositionId, in.PositionId, in.PositionId, in.SendId, in.PositionId, lastStr, in.PageSize)
|
|
|
+ in.PositionId, in.PositionId, in.SendId, in.SendId, in.PositionId, lastStr, in.PageSize)
|
|
|
break
|
|
|
case 3: //群聊天
|
|
|
|
|
|
- sqlStr = fmt.Sprintf("SELECT a.messag_id AS messageId,b.*,"+
|
|
|
+ sqlStr = fmt.Sprintf("SELECT a.messag_id AS messageId,b.*,a.send_user_type,a.type AS itemType,"+
|
|
|
"IF ( a.own_id = a.send_user_id, 1, 2 ) AS fool,"+
|
|
|
"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 = 2 AND a.own_id = %d "+
|
|
|
- "AND a.chat_group_id = %d AND a.type IN ( 3, 6 ) %s"+
|
|
|
+ "AND a.chat_group_id = %d AND a.type IN ( 3, 6 ) %s "+
|
|
|
"ORDER BY a.create_time desc,a.id DESC "+
|
|
|
"LIMIT 0, %d",
|
|
|
util.SOCIALIZE_MESSAGE_MAILBOX, util.SOCIALIZE_MESSAGE, in.PositionId,
|