mirror of
https://gitee.com/johng/gf
synced 2026-06-07 02:12:11 +08:00
fix issue in gdb.Model.Fields
This commit is contained in:
@ -42,6 +42,8 @@ func (m *Model) Fields(fieldNamesOrMapStruct ...interface{}) *Model {
|
||||
switch r := fieldNamesOrMapStruct[0].(type) {
|
||||
case string:
|
||||
model.fields = gstr.Join(m.mappingToTableFields([]string{r}), ",")
|
||||
case []string:
|
||||
model.fields = gstr.Join(m.mappingToTableFields(r), ",")
|
||||
default:
|
||||
model.fields = gstr.Join(m.mappingToTableFields(gutil.Keys(r)), ",")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user