diff --git a/src/dao/user_real_name_auth_dao.go b/src/dao/user_real_name_auth_dao.go index 6a38d1a..2513cea 100644 --- a/src/dao/user_real_name_auth_dao.go +++ b/src/dao/user_real_name_auth_dao.go @@ -6,6 +6,7 @@ import ( type UserRealNameAuthDao interface { GetRealNameAuthByUid(uid string) (m *model.UserRealNameAuth, err error) + GetRealNameAuthById(id string) (m *model.UserRealNameAuth, err error) GetRealNameAuthByUidWithState(uid, state string) (m *model.UserRealNameAuth, err error) GetRealNameAuthCount(uid int, cardNo string) (int64, error) GetRealNameAuthByOid(oid string) (*model.UserRealNameAuth, error) diff --git a/src/implement/user_real_name_auth_implement.go b/src/implement/user_real_name_auth_implement.go index eb93b3d..a640857 100644 --- a/src/implement/user_real_name_auth_implement.go +++ b/src/implement/user_real_name_auth_implement.go @@ -27,6 +27,17 @@ func (u UserRealNameAuthDb) GetRealNameAuthByUid(uid string) (m *model.UserRealN } return m, nil } +func (u UserRealNameAuthDb) GetRealNameAuthById(id string) (m *model.UserRealNameAuth, err error) { + m = new(model.UserRealNameAuth) + has, err := u.Db.Where("id=?", id).Get(m) + if err != nil { + return nil, zhios_order_relate_logx.Error(err) + } + if has == false { + return nil, nil + } + return m, nil +} func (u UserRealNameAuthDb) GetRealNameAuthByUidWithState(uid, state string) (m *model.UserRealNameAuth, err error) { m = new(model.UserRealNameAuth) has, err := u.Db.Where("uid = ? and state=?", uid, state).Get(m)