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