This commit is contained in:
aozhiwei 2024-04-11 19:27:19 +08:00
parent 8381e3af97
commit fe3c001cb7
2 changed files with 7 additions and 33 deletions

View File

@ -618,26 +618,10 @@ func (this *guildMgr) AsyncDisband(accountId string, cb func(int32, string, []st
cb(1, "Disband only leader perm", members) cb(1, "Disband only leader perm", members)
return return
} }
f5.GetJsStyleDb().Update( guild.disband()
constant.FRIEND_DB, task.SetSucc()
"t_guild", guild.disband()
[][]string{ cb(0, "", members)
{"deleted", "1"},
},
[][]string{
{"guild_id", guild.guildId},
},
func (err error, lastInsertId int64, rowsAffected int64) {
if err != nil {
task.SetFail()
cb(500, "server internal error", members)
return
}
task.SetSucc()
guild.disband()
cb(0, "", members)
return
})
}) })
} }
@ -795,21 +779,10 @@ func (this *guildMgr) clearEmptyGuild() {
return true return true
}) })
for _, g := range(emptyGuilds) { for _, g := range(emptyGuilds) {
delete(this.idHash, g.guildId) this.delGuild(g)
delete(this.nameHash, g.guildName)
GetDbLogMgr().GuildClearEmptyStart(g.guildId, g.guildName) GetDbLogMgr().GuildClearEmptyStart(g.guildId, g.guildName)
f5.GetJsStyleDb().Update( model.Guild.Delete(g.guildId,
constant.FRIEND_DB,
"t_guild_member",
[][]string{
{"guild_name", q5.ToString("!" + g.guildName)},
{"deleted", q5.ToString("1")},
},
[][]string{
{"guild_id", g.guildId},
},
func (err error, lastInsertId int64, rowsAffected int64) { func (err error, lastInsertId int64, rowsAffected int64) {
GetDbLogMgr().GuildClearEmptyEnd(g.guildId, g.guildName)
}) })
} }
} }

View File

@ -35,6 +35,7 @@ func (this *guild) Delete(guildId string,
constant.FRIEND_DB, constant.FRIEND_DB,
"t_guild", "t_guild",
[][]string{ [][]string{
{"!guild_name", q5.ToString("'!' + guild_name")},
{"deleted", "1"}, {"deleted", "1"},
}, },
[][]string{ [][]string{