This commit is contained in:
aozhiwei 2024-04-07 16:14:16 +08:00
parent c3e4e511d0
commit d53188ef18

View File

@ -165,7 +165,7 @@ func (this *friendMgr) AsyncGetApplyList(lastIdx int64, accountId string,
constant.FRIEND_DB,
50,
0,
"SELECT * FROM t_friend_apply",
"SELECT * FROM t_friend_apply WHERE 1=1",
[]string{},
f5.GetDbFilter().Comp(
f5.GetDbFilter().GT("idx", q5.ToString(lastIdx)).And(),
@ -174,18 +174,23 @@ func (this *friendMgr) AsyncGetApplyList(lastIdx int64, accountId string,
),
"",
func (err error, pg *f5.Pagination) {
var lastSinceId int64
var lastSinceId int64 = lastIdx
if err != nil {
cb(500, "", lastSinceId, []string{})
return
}
users := []string{}
if pg.Rows.Next() {
idx := q5.ToInt64(pg.Rows.GetByName("idx"))
accountId := pg.Rows.GetByName("account_id")
if idx > lastSinceId {
lastSinceId = idx
} else {
panic(fmt.Sprintf("AsyncGetApply idx error:%s %s", idx, lastSinceId))
}
*q5.NewSliceElement(&users) = accountId
}
cb(0, "", lastSinceId, users)
})
}