Browse Source

'fix'

master
u 2 years ago
parent
commit
47edc058fe
  1. 32
      hasaki-gen-crud/template.go

32
hasaki-gen-crud/template.go

@ -213,6 +213,15 @@ func (TempLowHead3A60 *Temp3A60) Load() (err error) {
session = session.Table(TempLowHead3A60)
raw := map[string]interface{}{}
session.Get(&raw)
//xorm兼容性处理
for i := range raw {
value := gjson.Parse(cast.ToString(raw[i])).Value()
if value != nil {
raw[i] = value
} else {
raw[i] = cast.ToString(raw[i])
}
}
for _, v := range structField {
raw[v] = gjson.Parse(cast.ToString(raw[v])).Value()
@ -276,6 +285,18 @@ func (TempLowHead3A60 *Temp3A60) Data() (data []Temp3A60) {
raw := []map[string]interface{}{}
session.Find(&raw)
//xorm兼容性处理
for i := range raw {
for k := range raw[i] {
value := gjson.Parse(cast.ToString(raw[i][k])).Value()
if value != nil {
raw[i][k] = value
} else {
raw[i][k] = cast.ToString(raw[i][k])
}
}
}
for i := range raw {
item := Temp3A60{}
@ -343,6 +364,17 @@ func (TempLowHead3A60 *Temp3A60) PageData(page, pageSize int) (data []Temp3A60,
session = session.Table(TempLowHead3A60)
raw := []map[string]interface{}{}
count, _ = session.FindAndCount(&raw)
//xorm兼容性处理
for i := range raw {
for k := range raw[i] {
value := gjson.Parse(cast.ToString(raw[i][k])).Value()
if value != nil {
raw[i][k] = value
} else {
raw[i][k] = cast.ToString(raw[i][k])
}
}
}
for i := range raw {
item := Temp3A60{}

Loading…
Cancel
Save