This commit is contained in:
aozhiwei 2024-04-11 17:19:59 +08:00
parent 831d2480fc
commit a6a7fed770
2 changed files with 42 additions and 21 deletions

View File

@ -326,29 +326,12 @@ func (this *guildMgr) AsyncApplyJoin(accountId string, guildId string, cb func(i
cb(0, "") cb(0, "")
return return
} }
nowTime := f5.GetApp().GetNowSeconds() model.GuildApply.Force(
f5.GetJsStyleDb().Upsert( guildId,
constant.FRIEND_DB, accountId,
"t_guild_apply",
[][]string{
{"guild_id", guildId},
{"account_id", accountId},
},
[][]string{
{"status", q5.ToString(constant.GUILD_APPLY_STATUS_NONE)},
{"last_apply_time", q5.ToString(nowTime)},
},
[][]string{
{"guild_id", guildId},
{"account_id", accountId},
{"status", q5.ToString(constant.GUILD_APPLY_STATUS_NONE)},
{"last_apply_time", q5.ToString(nowTime)},
{"createtime", q5.ToString(nowTime)},
{"modifytime", q5.ToString(nowTime)},
},
func (err error, lastInsertId int64, rowsAffected int64) { func (err error, lastInsertId int64, rowsAffected int64) {
if err != nil { if err != nil {
cb(1, "") cb(500, "server internal error")
return return
} }
cb(0, "") cb(0, "")

View File

@ -0,0 +1,38 @@
package model
import (
"q5"
"f5"
"main/constant"
)
type guildApply struct {
}
var GuildApply = new (guildApply)
func (this *guildApply) Force(guildId string, accountId string,
cb func (error, int64, int64)) {
nowTime := f5.GetApp().GetNowSeconds()
f5.GetJsStyleDb().Upsert(
constant.FRIEND_DB,
"t_guild_apply",
[][]string{
{"guild_id", guildId},
{"account_id", accountId},
},
[][]string{
{"status", q5.ToString(constant.GUILD_APPLY_STATUS_NONE)},
{"last_apply_time", q5.ToString(nowTime)},
},
[][]string{
{"guild_id", guildId},
{"account_id", accountId},
{"status", q5.ToString(constant.GUILD_APPLY_STATUS_NONE)},
{"last_apply_time", q5.ToString(nowTime)},
{"createtime", q5.ToString(nowTime)},
{"modifytime", q5.ToString(nowTime)},
},
cb)
}