This commit is contained in:
aozhiwei 2024-03-30 13:03:53 +08:00
parent 9bfe0fb0ea
commit dbfb8f6e29
2 changed files with 34 additions and 3 deletions

View File

@ -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,

View File

@ -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)) {