Sfoglia il codice sorgente

未读数量查询

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

+ 1 - 1
service/message_mail_box.go

@@ -70,7 +70,7 @@ func (b MessaggeService) UserList(in *messagecenter.UserReq) (data *[]map[string
 		if data != nil {
 			customerMessageId := util.Inhandle(data)
 			//客服的用户列表
-			sqlStr = "SELECT  IF  ( b.nickname = '', CONCAT(SUBSTR( b.phone, 1, 3 ),'****',SUBSTR( b.phone, 8, 11)), b.nickname ) AS name,  b.id,  e.title,  b.headimg,  e.type,  e.link,  e.content,  a.create_time,  (  SELECT   count( h.id )   FROM   socialize_message_mailbox h   WHERE   (  h.type = 4 OR h.type = 5 or  h.type=6 or  h.type=7 )    AND h.own_type = 1 and   AND  h.receive_user_id = f.id and h.receive_user_typ=1     AND h.isread = 0   ) AS number   FROM  socialize_message_mailbox a  LEFT JOIN base_user b ON  IF  ( a.send_user_type = 1, b.id = a.receive_user_id, b.id = a.send_user_id )  LEFT JOIN socialize_message e ON e.id = a.messag_id  LEFT JOIN socialize_chat_session f ON  IF  ( a.send_user_type = 1, f.id = a.send_user_id, f.id = a.receive_user_id )   WHERE  a.id IN  (" + customerMessageId + ")" + phoneSql + "   ORDER BY  a.create_time DESC"
+			sqlStr = "SELECT  IF  ( b.nickname = '', CONCAT(SUBSTR( b.phone, 1, 3 ),'****',SUBSTR( b.phone, 8, 11)), b.nickname ) AS name,  b.id,  e.title,  b.headimg,  e.type,  e.link,  e.content,  a.create_time,  (  SELECT   count( h.id )   FROM   socialize_message_mailbox h   WHERE   (  h.type = 4 OR h.type = 5 or  h.type=6 or  h.type=7 )    AND h.own_type = 1    AND  h.receive_user_id = f.id and h.receive_user_type=1     AND h.isread = 0   ) AS number   FROM  socialize_message_mailbox a  LEFT JOIN base_user b ON  IF  ( a.send_user_type = 1, b.id = a.receive_user_id, b.id = a.send_user_id )  LEFT JOIN socialize_message e ON e.id = a.messag_id  LEFT JOIN socialize_chat_session f ON  IF  ( a.send_user_type = 1, f.id = a.send_user_id, f.id = a.receive_user_id )   WHERE  a.id IN  (" + customerMessageId + ")" + phoneSql + "   ORDER BY  a.create_time DESC"
 			fmt.Println(in.EntUserId)
 			v = make([]interface{}, 0)
 		}