From f0cf5548976dc12077dfbb90915a746592f769a2 Mon Sep 17 00:00:00 2001 From: DengBiao <2319963317@qq.com> Date: Fri, 2 Dec 2022 22:33:30 +0800 Subject: [PATCH] update --- internal/business/comm/db/db_user_push_for_jg.go | 3 +-- internal/business/domain/user/service/auth.go | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/internal/business/comm/db/db_user_push_for_jg.go b/internal/business/comm/db/db_user_push_for_jg.go index 12988f5..3b94db6 100644 --- a/internal/business/comm/db/db_user_push_for_jg.go +++ b/internal/business/comm/db/db_user_push_for_jg.go @@ -40,8 +40,7 @@ func (*dbUserPushForJg) UserPushForJgInsert(uid, masterId int64, pushAlia string // UserPushForJgUpdate 修改某条配置信息 func (*dbUserPushForJg) UserPushForJgUpdate(uid, masterId int64, pushAlia string) bool { - cfg := model.UserPushForJg{Uid: uid, PushAlia: pushAlia, MasterId: masterId} - err := db.DB.Where("`uid` = ? and `master_id` = ?", uid, masterId).Update(&cfg).Error + err := db.DB.Model(&model.UserPushForJg{}).Where("`uid` = ? and `master_id` = ?", uid, masterId).Update("push_alia", pushAlia).Error if err != nil { logx.Error(err) return false diff --git a/internal/business/domain/user/service/auth.go b/internal/business/domain/user/service/auth.go index 0e53c2e..072255e 100644 --- a/internal/business/domain/user/service/auth.go +++ b/internal/business/domain/user/service/auth.go @@ -63,7 +63,7 @@ func (*authService) SignIn(ctx context.Context, phoneNumber, code string, master if pushAlia != "" { userPushForJg, err := db.DbUserPushForJg.UserPushForJgGetOne(strconv.FormatInt(user.Id, 10), masterId) - if err != nil && err.Error() != "record not found" { + if err != nil { return false, 0, "", 0, err } if userPushForJg == nil {