Merge branch 'develop' of gitee.com:fusenpack/fusenapi into develop

This commit is contained in:
momo
2023-09-21 19:02:05 +08:00
16 changed files with 187 additions and 193 deletions

View File

@@ -52,6 +52,7 @@ func MetadataModulePATCH(tx *gorm.DB, module string, tableStructPointer any, upd
if stype.Kind() == reflect.Pointer {
stype = stype.Elem()
}
tname := tx.NamingStrategy.TableName(stype.Name())
updatesql := `UPDATE %s
SET metadata = CASE
@@ -80,7 +81,7 @@ func MetadataModulePATCH(tx *gorm.DB, module string, tableStructPointer any, upd
args = append(args, metadata, metadata)
args = append(args, values...)
updatesql = fmt.Sprintf(updatesql, tx.NamingStrategy.TableName(stype.Name()), module, WhereKeysCond)
updatesql = fmt.Sprintf(updatesql, tname, module, WhereKeysCond)
// logx.Error(updatesql)
err = tx.Exec(updatesql, args...).Error
if err != nil {