|
|
@ -180,15 +180,14 @@ func (TempLowHead3A60 *Temp3A60) getFieldTypes() map[string]reflect.Kind { |
|
|
|
|
|
|
|
func (TempLowHead3A60 *Temp3A60) fixSqlRowMap(fieldType map[string]reflect.Kind, raw map[string]interface{}) map[string]interface{} { |
|
|
|
for i := range raw { |
|
|
|
// log.Println(i, fieldType[i], cast.ToString(raw[i]))
|
|
|
|
switch fieldType[i] { |
|
|
|
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: |
|
|
|
raw[i] = cast.ToInt64(raw[i]) |
|
|
|
raw[i] = cast.ToInt64(cast.ToString(raw[i])) |
|
|
|
case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: |
|
|
|
raw[i] = cast.ToUint64(raw[i]) |
|
|
|
raw[i] = cast.ToUint64(cast.ToString(raw[i])) |
|
|
|
case reflect.Float32, reflect.Float64: |
|
|
|
raw[i] = cast.ToFloat64(raw[i]) |
|
|
|
case reflect.Bool: |
|
|
|
raw[i] = cast.ToBool(raw[i]) |
|
|
|
raw[i] = cast.ToFloat64(cast.ToString(raw[i])) |
|
|
|
case reflect.String: |
|
|
|
raw[i] = cast.ToString(raw[i]) |
|
|
|
case reflect.Slice, reflect.Array, reflect.Map, reflect.Struct, reflect.Ptr: |
|
|
@ -350,18 +349,6 @@ 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{} |
|
|
|
|
|
|
|