improve condition parameter of struct by sequence for package gdb

This commit is contained in:
John Guo
2021-08-19 14:11:28 +08:00
parent 8f4ce91361
commit feefcc98ef

View File

@ -480,6 +480,7 @@ func formatWhere(db DB, in formatWhereInput) (newWhere string, newArgs []interfa
if in.Table != "" {
data, _ = db.GetCore().mappingAndFilterData(in.Schema, in.Table, data, true)
}
// Put the struct attributes in sequence in Where statement.
for i := 0; i < reflectType.NumField(); i++ {
structField = reflectType.Field(i)
foundKey, foundValue := gutil.MapPossibleItemByKey(data, structField.Name)