diff --git a/src/dao/public_platoon_free_punish_with_user_dao.go b/src/dao/public_platoon_free_punish_with_user_dao.go index 1af14bf..43b0ab7 100644 --- a/src/dao/public_platoon_free_punish_with_user_dao.go +++ b/src/dao/public_platoon_free_punish_with_user_dao.go @@ -11,4 +11,5 @@ type PublicPlatoonFreePunishWithUserDao interface { PublicPlatoonFreePunishWithUserUpdate(Db *xorm.Engine, id interface{}, PublicPlatoonFreePunishWithUser *model.PublicPlatoonFreePunishWithUser, forceColums ...string) (int64, error) PublicPlatoonFreePunishWithUserCountAndGetPageByParams(page int, limit int, params map[string]interface{}) ([]model.PublicPlatoonFreePunishWithUser, int64, error) PublicPlatoonFreePunishWithUserGetOneByParams(params map[string]interface{}) (*model.PublicPlatoonFreePunishWithUser, error) + PublicPlatoonFreePunishWithUserDeleteOneByUID(uid int64) (int64, error) } diff --git a/src/dao/user_level_dao.go b/src/dao/user_level_dao.go index ebbc5a1..b23c6f7 100644 --- a/src/dao/user_level_dao.go +++ b/src/dao/user_level_dao.go @@ -1,6 +1,9 @@ package dao -import "code.fnuoos.com/EggPlanet/egg_models.git/src/model" +import ( + "code.fnuoos.com/EggPlanet/egg_models.git/src/model" + "xorm.io/xorm" +) type UserLevelDao interface { //UserLevelInIDescByWeightLowWithOne 查询获取 权重最低 对应等级 @@ -12,4 +15,5 @@ type UserLevelDao interface { // UserLevelAllByAscByPage 获取所有开启等级升序分页返回 UserLevelAllByAscByPage(page, limit int) ([]*model.UserLevel, int64, error) UserLevelUpdate(id interface{}, level *model.UserLevel, forceColumns ...string) (int64, error) + UserLevelDeleteBySession(session *xorm.Session, id interface{}) (int64, error) } diff --git a/src/implement/public_platoon_free_punish_with_user_implement.go b/src/implement/public_platoon_free_punish_with_user_implement.go index c1c8827..fae8792 100644 --- a/src/implement/public_platoon_free_punish_with_user_implement.go +++ b/src/implement/public_platoon_free_punish_with_user_implement.go @@ -78,3 +78,11 @@ func (p PublicPlatoonFreePunishWithUserDb) PublicPlatoonFreePunishWithUserGetOne } return &m, nil } + +func (p PublicPlatoonFreePunishWithUserDb) PublicPlatoonFreePunishWithUserDeleteOneByUID(uid int64) (int64, error) { + affected, err := p.Db.Where("uid=?", uid).Delete(&model.PublicPlatoonFreePunishWithUser{}) + if err != nil { + return 0, zhios_order_relate_logx.Error(err.Error()) + } + return affected, nil +} diff --git a/src/implement/user_level_implement.go b/src/implement/user_level_implement.go index ddba709..76c2469 100644 --- a/src/implement/user_level_implement.go +++ b/src/implement/user_level_implement.go @@ -74,3 +74,11 @@ func (u UserLevelDb) UserLevelUpdate(id interface{}, userLevel *model.UserLevel, } return affected, nil } + +func (u UserLevelDb) UserLevelDeleteBySession(session *xorm.Session, id interface{}) (int64, error) { + affected, err := session.Where("id = ?", id).Delete(&model.UserLevel{}) + if err != nil { + return 0, err + } + return affected, nil +}