From 5bedfc923717824e01f9c41e89926fba2da48afe Mon Sep 17 00:00:00 2001 From: eson <474420502@qq.com> Date: Sun, 10 Sep 2023 03:09:48 +0800 Subject: [PATCH] fix --- model/gmodel/fs_user_logic.go | 6 +----- utils/fssql/metadata.go | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/model/gmodel/fs_user_logic.go b/model/gmodel/fs_user_logic.go index dd0cf675..79a3d1fa 100644 --- a/model/gmodel/fs_user_logic.go +++ b/model/gmodel/fs_user_logic.go @@ -218,21 +218,17 @@ func (u *FsUserModel) RegisterByFusen(ctx context.Context, token *auth.RegisterT // txUserInfo.Statement.Table if err != nil { - if err == gorm.ErrRecordNotFound { err = txUserInfo.Create(uinfo).Error if err == gorm.ErrRecordNotFound { return nil } } - } else { - - err = fssql.MetadataModulePATCH(txUserInfo, "profile", FsUser{}, metadata, "user_id = ?", *uinfo.UserId) + err = fssql.MetadataModulePATCH(txUserInfo, "profile", FsUserInfo{}, metadata, "user_id = ?", *uinfo.UserId) if err != nil { return err } - } return err }) diff --git a/utils/fssql/metadata.go b/utils/fssql/metadata.go index e56385b0..143354c0 100644 --- a/utils/fssql/metadata.go +++ b/utils/fssql/metadata.go @@ -116,7 +116,7 @@ func MetadataResourcePATCH(tx *gorm.DB, rid string, updateMetadata any, values . ELSE JSON_MERGE_PATCH(metadata, ?) END cond, ok := values[0].(string) - WHERE resource_id = '%s'` + "and " + cond + `;` + WHERE resource_id = '%s'` + " and " + cond + `;` } var err error