Explorar o código

fix:分页参数修改

duxin %!s(int64=2) %!d(string=hai) anos
pai
achega
5228cd540d
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      rpc/internal/common/sendMsg.go

+ 3 - 0
rpc/internal/common/sendMsg.go

@@ -187,6 +187,9 @@ func UserMsgList(this *message.UserMsgListReq) *message.UserMsgList {
 	count = entity.Mysql.Count("message", cquery)
 	if this.IsMsgList {
 		if count > 0 {
+			if this.OffSet <= 0 {
+				this.OffSet = 1
+			}
 			res := entity.Mysql.Find("message", cquery, "", "createtime desc", (int(this.OffSet)-1)*int(this.PageSize), int(this.PageSize))
 			if res != nil && len(*res) > 0 {
 				for _, v := range *res {