LinsRuis.HW1 3 months ago
parent
commit
514e34811f
  1. 9
      core/comms/xorms.go

9
core/comms/xorms.go

@ -27,6 +27,8 @@ func XormOneDb(db *gocloud.DBHelper, id, data interface{}, columns ...interface{
if len(columns) > 2 && columns[1] != nil && columns[2] != nil {
tb = columns[1]
tbcol = columns[2]
} else if len(columns) > 1 && columns[1] != nil {
tbcol = columns[1]
}
} else {
if len(columns) > 1 && columns[1] != nil {
@ -34,10 +36,13 @@ func XormOneDb(db *gocloud.DBHelper, id, data interface{}, columns ...interface{
tbcol = columns[1]
}
}
if tb != nil && tbcol != nil {
if tb != nil {
ses = ses.Table(tb)
}
if tbcol != nil {
cols, ok := tbcol.(string)
if ok {
ses = ses.Table(tb).Cols(cols)
ses = ses.Cols(cols)
}
}
has, err := ses.Get(data)

Loading…
Cancel
Save