1
This commit is contained in:
parent
9bfe0fb0ea
commit
dbfb8f6e29
@ -159,7 +159,8 @@ func (this *friendMgr) getBlacks(accountId string) *map[string]int32 {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (this *friendMgr) AsyncGetApplyList(lastIdx int64, accountId string, cb func(int32, string, int64, []string)) {
|
||||
func (this *friendMgr) AsyncGetApplyList(lastIdx int64, accountId string,
|
||||
cb func(int32, string, int64, []string)) {
|
||||
f5.GetJsStyleDb().PageQuery(
|
||||
constant.FRIEND_DB,
|
||||
50,
|
||||
|
@ -1,7 +1,11 @@
|
||||
package guild
|
||||
|
||||
import (
|
||||
"q5"
|
||||
"f5"
|
||||
"main/common"
|
||||
"main/constant"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
const (
|
||||
@ -51,8 +55,34 @@ func (this *guildMgr) AsyncCreateGuild(string, string, func(int32, string, int64
|
||||
|
||||
}
|
||||
|
||||
func (this *guildMgr) AsyncGetApplyList(int64, string, func(int32, string, int64, []string)) {
|
||||
|
||||
func (this *guildMgr) AsyncGetApplyList(lastIdx int64, accountId string,
|
||||
cb func(int32, string, int64, []string)) {
|
||||
f5.GetJsStyleDb().PageQuery(
|
||||
constant.FRIEND_DB,
|
||||
50,
|
||||
0,
|
||||
"SELECT * FROM t_guild_apply",
|
||||
[]string{},
|
||||
f5.GetDbFilter().Comp(
|
||||
f5.GetDbFilter().GT("idx", q5.ToString(lastIdx)).And(),
|
||||
f5.GetDbFilter().EQ("account_id", accountId).And(),
|
||||
f5.GetDbFilter().EQ("status", "0"),
|
||||
),
|
||||
"",
|
||||
func (err error, pg *f5.Pagination) {
|
||||
var lastSinceId int64
|
||||
if err != nil {
|
||||
cb(500, "", lastSinceId, []string{})
|
||||
}
|
||||
if pg.Rows.Next() {
|
||||
idx := q5.ToInt64(pg.Rows.GetByName("idx"))
|
||||
if idx > lastSinceId {
|
||||
lastSinceId = idx
|
||||
} else {
|
||||
panic(fmt.Sprintf("AsyncGetApply idx error:%s %s", idx, lastSinceId))
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
func (this *guildMgr) AsyncApplyJoin(string, string, func(int32, string)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user