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 0ccca83..1af14bf 100644 --- a/src/dao/public_platoon_free_punish_with_user_dao.go +++ b/src/dao/public_platoon_free_punish_with_user_dao.go @@ -10,4 +10,5 @@ type PublicPlatoonFreePunishWithUserDao interface { PublicPlatoonFreePunishWithUserInsert(PublicPlatoonFreePunishWithUser *model.PublicPlatoonFreePunishWithUser) (int, error) 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) } 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 613949d..c1c8827 100644 --- a/src/implement/public_platoon_free_punish_with_user_implement.go +++ b/src/implement/public_platoon_free_punish_with_user_implement.go @@ -69,3 +69,12 @@ func (p PublicPlatoonFreePunishWithUserDb) PublicPlatoonFreePunishWithUserCountA } return m, total, nil } + +func (p PublicPlatoonFreePunishWithUserDb) PublicPlatoonFreePunishWithUserGetOneByParams(params map[string]interface{}) (*model.PublicPlatoonFreePunishWithUser, error) { + var m model.PublicPlatoonFreePunishWithUser + var query = fmt.Sprintf("%s =?", params["key"]) + if has, err := p.Db.Where(query, params["value"]).Get(&m); err != nil || has == false { + return nil, zhios_order_relate_logx.Error(err) + } + return &m, nil +}