Przeglądaj źródła

未读数量查询修改

WH01243 3 lat temu
rodzic
commit
9476164f45

+ 2 - 2
rpc/messagecenter/test/message_test.go

@@ -90,10 +90,10 @@ func Test_SaveMessage(t *testing.T) {
 
 //
 func Test_test1(t *testing.T) {
-	a := encrypt.SE.Encode2Hex("2742")
+	a := encrypt.SE.Encode2Hex("1")
 	fmt.Println(a)
 	fmt.Println(encrypt.SE.Decode4Hex(a))
-	fmt.Println(encrypt.SE.Decode4Hex("415a4856"))
+	fmt.Println(encrypt.SE.Decode4Hex("4657465d5d"))
 	fmt.Println(encrypt.SE.Decode4Hex("4157435b52"))
 
 	/*for d := 0; d <10 ; d++ {

+ 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  IF   ( h.send_user_type = 1, h.send_user_id = f.id, h.receive_user_id = f.id )    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   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"
 			fmt.Println(in.EntUserId)
 			v = make([]interface{}, 0)
 		}