70 lines
1.5 KiB
Go
70 lines
1.5 KiB
Go
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)
|
|
}
|
|
|
|
func (this *guildApply) SetStatus(guildId string, accountId string, status int32,
|
|
cb func (error, int64, int64)) {
|
|
f5.GetJsStyleDb().Update(
|
|
constant.FRIEND_DB,
|
|
"t_guild_apply",
|
|
[][]string{
|
|
{"account_id", accountId},
|
|
{"guild_id", guildId},
|
|
},
|
|
[][]string{
|
|
{"status", q5.ToString(status)},
|
|
{"modifytime", q5.ToString(f5.GetApp().GetNowSeconds())},
|
|
},
|
|
cb)
|
|
}
|
|
|
|
func (this *guildApply) Clear(guildId string,
|
|
cb func (error, int64, int64)) {
|
|
f5.GetJsStyleDb().Update(
|
|
constant.FRIEND_DB,
|
|
"t_guild_apply",
|
|
[][]string{
|
|
{"guild_id", guildId},
|
|
},
|
|
[][]string{
|
|
{"deleted", "1"},
|
|
},
|
|
func (err error, lastInsertId int64, rowsAffected int64) {
|
|
})
|
|
}
|