1
0
mirror of https://github.com/1Panel-dev/1Panel.git synced 2025-01-19 08:19:15 +08:00

feat: 回滚代码 (#5914)

This commit is contained in:
zhengkunwang 2024-07-23 14:42:06 +08:00 committed by GitHub
parent 2873632a40
commit f04be521e5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -96,9 +96,11 @@ func OperationLog() gin.HandlerFunc {
if funcs.InputValue == key { if funcs.InputValue == key {
var names []string var names []string
if funcs.IsList { if funcs.IsList {
_ = global.DB.Raw("select ? from ? where ? in (?);", funcs.OutputColumn, funcs.DB, funcs.InputColumn, value).Scan(&names) query := fmt.Sprintf("SELECT %s FROM %s WHERE %s in (?)", funcs.OutputColumn, funcs.DB, funcs.InputColumn)
_ = global.DB.Raw(query, value).Scan(&names)
} else { } else {
_ = global.DB.Raw("select ? from ? where ? = ?;", funcs.OutputColumn, funcs.DB, funcs.InputColumn, value).Scan(&names) query := fmt.Sprintf("SELECT %s FROM %s WHERE %s = ?", funcs.OutputColumn, funcs.DB, funcs.InputColumn)
_ = global.DB.Raw(query, value).Scan(&names)
} }
formatMap[funcs.OutputValue] = strings.Join(names, ",") formatMap[funcs.OutputValue] = strings.Join(names, ",")
break break