From 58e20681700518bed72c8c2bf9feffd5bb470e87 Mon Sep 17 00:00:00 2001 From: eson <474420502@qq.com> Date: Thu, 21 Sep 2023 23:47:34 +0800 Subject: [PATCH] fix --- model/gmodel/fs_user_logic.go | 6 +++--- utils/fssql/metadata.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/model/gmodel/fs_user_logic.go b/model/gmodel/fs_user_logic.go index 7cafa412..aaac1784 100644 --- a/model/gmodel/fs_user_logic.go +++ b/model/gmodel/fs_user_logic.go @@ -65,7 +65,7 @@ func InheritGuestIdResource(tx *gorm.DB, userId, guestId int64, afterDo func(txR if guestId != 0 { // 继承guest_id的资源表 err = txRes. - Where("guest_id = ?", guestId). + Where("guest_id = ? and module != 'clear' and module != 'temp'", guestId). UpdateColumn("user_id", userId).Error if err != nil && err != gorm.ErrRecordNotFound { @@ -73,7 +73,7 @@ func InheritGuestIdResource(tx *gorm.DB, userId, guestId int64, afterDo func(txR } err = txUserMaterial. - Where("guest_id = ?", guestId). + Where("guest_id = ? and module != 'clear' and module != 'temp'", guestId). UpdateColumn("user_id", userId).Error if err != nil && err != gorm.ErrRecordNotFound { @@ -82,7 +82,7 @@ func InheritGuestIdResource(tx *gorm.DB, userId, guestId int64, afterDo func(txR } err = txUserInfo. - Where("guest_id = ?", guestId). + Where("guest_id = ? and module != 'clear' and module != 'temp' ", guestId). UpdateColumn("user_id", userId).Error logx.Info(err, "guest_id = ", guestId) if err != nil && err != gorm.ErrRecordNotFound { diff --git a/utils/fssql/metadata.go b/utils/fssql/metadata.go index ea13311d..8c25b343 100644 --- a/utils/fssql/metadata.go +++ b/utils/fssql/metadata.go @@ -59,7 +59,7 @@ func MetadataModulePATCH(tx *gorm.DB, module string, tableStructPointer any, upd WHEN metadata IS NULL THEN ? ELSE JSON_MERGE_PATCH(metadata, ?) END - WHERE order_sn = '%s' and %s;` + WHERE module = '%s' and %s;` var err error var metadata []byte