Browse Source

fix:浮标消息判断去空

duxin 2 years ago
parent
commit
40da7c5dd8
1 changed files with 2 additions and 8 deletions
  1. 2 8
      service/getBuoyMsg.go

+ 2 - 8
service/getBuoyMsg.go

@@ -4,20 +4,14 @@ import (
 	"app.yhyue.com/moapp/MessageCenter/entity"
 	"app.yhyue.com/moapp/MessageCenter/rpc/message"
 	"app.yhyue.com/moapp/MessageCenter/util"
+	"fmt"
 	"strconv"
 )
 
 func FindUserBuoyMsg(this *message.FindUserBuoyMsgReq) *message.FindUserBuoyMsgRes {
 	var err error
-	query := map[string]interface{}{
-		"receive_userid": this.UserId,
-		"isdel":          1,
-		"appid":          this.Appid,
-		"isRead":         0,
-		"show_buoy":      1,
-	}
 	data := message.FindUserBuoyMsgRes{}
-	res := entity.Mysql.Find("message", query, "", "createtime desc", 0, int(this.PageSize))
+	res := entity.Mysql.SelectBySql(fmt.Sprintf(`SELECT * FROM message WHERE receive_userid = "%s" and isdel = 1 and appid = %s and isRead =0 and show_buoy = 1 and show_content != "" ORDER BY createtime DESC  LIMIT 0,%d`, this.UserId, this.Appid, int(this.PageSize)))
 	//log.Println("数据:", res)
 	if res != nil && len(*res) > 0 {
 		for _, v := range *res {