From e9cbd65b0bfbcbc1f01525313e2a50474d3311e3 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Fri, 29 Nov 2024 13:52:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E5=90=8D=E8=AE=A4=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/dao/user_real_name_auth_dao.go | 1 + src/implement/user_real_name_auth_implement.go | 11 +++++++++++ 2 files changed, 12 insertions(+) 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)