diff --git a/server/imserver_new/friend/friendmgr.go b/server/imserver_new/friend/friendmgr.go index 51293aa0..6d3c3807 100644 --- a/server/imserver_new/friend/friendmgr.go +++ b/server/imserver_new/friend/friendmgr.go @@ -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) }) }