|
@@ -78,19 +78,17 @@ func FindUserMsg(this message.FindUserMsgReq) message.FindUserMsgRes {
|
|
|
//var messages []*entity.Message
|
|
|
var err error
|
|
|
var count int64
|
|
|
- q := ""
|
|
|
- if this.MsgType != -1 {
|
|
|
- q += fmt.Sprintf(" and msg_type = %d", this.MsgType)
|
|
|
- }
|
|
|
- if this.Read != -1 {
|
|
|
- q += fmt.Sprintf(" and isRead = %d", this.Read)
|
|
|
-
|
|
|
- }
|
|
|
cquery := map[string]interface{}{
|
|
|
"receive_userid": this.UserId,
|
|
|
"isdel": 1,
|
|
|
"appid": this.Appid,
|
|
|
}
|
|
|
+ if this.MsgType != -1 {
|
|
|
+ cquery["msg_type"] = this.MsgType
|
|
|
+ }
|
|
|
+ if this.Read != -1 {
|
|
|
+ cquery["isRead"] = this.Read
|
|
|
+ }
|
|
|
count = entity.Mysql.Count("message", cquery)
|
|
|
//count, err = orm.Table("message").Where("((receive_userid = ? and send_userid = ?) or (receive_userid = ? and send_userid = ?)) and isdel = ? and appid = ?"+q, this.UserId, this.ReceiveUserId, this.ReceiveUserId, this.UserId, 1, this.Appid).Count()
|
|
|
data := message.FindUserMsgRes{}
|
|
@@ -114,7 +112,7 @@ func FindUserMsg(this message.FindUserMsgReq) message.FindUserMsgRes {
|
|
|
SendName: util.ObjToString(v["sendName"]),
|
|
|
Createtime: util.ObjToString(v["createTime"]),
|
|
|
Title: util.ObjToString(v["title"]),
|
|
|
- MsgType: util.Int64All(v["msgType"]),
|
|
|
+ MsgType: int64(util.IntAll(v["msgType"])),
|
|
|
Link: util.ObjToString(v["link"]),
|
|
|
CiteId: util.Int64All(v["citeId"]),
|
|
|
Content: util.ObjToString(v["content"]),
|