|
@@ -305,37 +305,36 @@ func UserUnreadMsgList(this *message.UserUnreadMsgListReq) (int64, []*message.Me
|
|
|
}
|
|
|
|
|
|
func MessageGetLast(this *message.UserMsgListReq) *message.Messages {
|
|
|
- if this.IsColumn {
|
|
|
- query := map[string]interface{}{
|
|
|
- "receive_userid": this.UserId,
|
|
|
- "isdel": 1,
|
|
|
- "appid": this.Appid,
|
|
|
- "isRead": 0,
|
|
|
- "msg_type": 1,
|
|
|
- }
|
|
|
- lastMsg := entity.Mysql.FindOne("message", query, "", "createtime desc")
|
|
|
- if lastMsg != nil && len(*lastMsg) > 0 {
|
|
|
- _id := util.Int64All((*lastMsg)["id"])
|
|
|
- id := strconv.FormatInt(_id, 10)
|
|
|
- msg := message.Messages{
|
|
|
- Id: id,
|
|
|
- Appid: common.InterfaceToStr((*lastMsg)["appid"]),
|
|
|
- ReceiveUserId: common.InterfaceToStr((*lastMsg)["receive_userid"]),
|
|
|
- ReceiveName: common.InterfaceToStr((*lastMsg)["receive_name"]),
|
|
|
- SendUserId: common.InterfaceToStr((*lastMsg)["send_userid"]),
|
|
|
- SendName: common.InterfaceToStr((*lastMsg)["send_name"]),
|
|
|
- Createtime: common.InterfaceToStr((*lastMsg)["createtime"]),
|
|
|
- Title: common.InterfaceToStr((*lastMsg)["title"]),
|
|
|
- MsgType: common.Int64All((*lastMsg)["msg_type"]),
|
|
|
- Link: common.InterfaceToStr((*lastMsg)["link"]),
|
|
|
- CiteId: common.Int64All((*lastMsg)["cite_id"]),
|
|
|
- Content: common.InterfaceToStr((*lastMsg)["content"]),
|
|
|
- IsRead: common.Int64All((*lastMsg)["isRead"]),
|
|
|
- MsgLogId: common.Int64All((*lastMsg)["msg_log_id"]),
|
|
|
- }
|
|
|
- return &msg
|
|
|
+ query := map[string]interface{}{
|
|
|
+ "receive_userid": this.UserId,
|
|
|
+ "isdel": 1,
|
|
|
+ "appid": this.Appid,
|
|
|
+ "isRead": 0,
|
|
|
+ "msg_type": 1,
|
|
|
+ }
|
|
|
+ lastMsg := entity.Mysql.FindOne("message", query, "", "createtime desc")
|
|
|
+ if lastMsg != nil && len(*lastMsg) > 0 {
|
|
|
+ _id := util.Int64All((*lastMsg)["id"])
|
|
|
+ id := strconv.FormatInt(_id, 10)
|
|
|
+ msg := message.Messages{
|
|
|
+ Id: id,
|
|
|
+ Appid: common.InterfaceToStr((*lastMsg)["appid"]),
|
|
|
+ ReceiveUserId: common.InterfaceToStr((*lastMsg)["receive_userid"]),
|
|
|
+ ReceiveName: common.InterfaceToStr((*lastMsg)["receive_name"]),
|
|
|
+ SendUserId: common.InterfaceToStr((*lastMsg)["send_userid"]),
|
|
|
+ SendName: common.InterfaceToStr((*lastMsg)["send_name"]),
|
|
|
+ Createtime: common.InterfaceToStr((*lastMsg)["createtime"]),
|
|
|
+ Title: common.InterfaceToStr((*lastMsg)["title"]),
|
|
|
+ MsgType: common.Int64All((*lastMsg)["msg_type"]),
|
|
|
+ Link: common.InterfaceToStr((*lastMsg)["link"]),
|
|
|
+ CiteId: common.Int64All((*lastMsg)["cite_id"]),
|
|
|
+ Content: common.InterfaceToStr((*lastMsg)["content"]),
|
|
|
+ IsRead: common.Int64All((*lastMsg)["isRead"]),
|
|
|
+ MsgLogId: common.Int64All((*lastMsg)["msg_log_id"]),
|
|
|
}
|
|
|
+ return &msg
|
|
|
}
|
|
|
+
|
|
|
return nil
|
|
|
}
|
|
|
|