- 添加了部分到家订单级促销
This commit is contained in:
@@ -454,6 +454,8 @@ func FlatMap(in map[string]interface{}) map[string]interface{} {
|
||||
vMap = FlatMap(vMap)
|
||||
maps = append(maps, vMap)
|
||||
keys = append(keys, k)
|
||||
} else {
|
||||
fmt.Printf("%s is %s\n", k, reflect.TypeOf(v).String())
|
||||
}
|
||||
}
|
||||
if len(maps) > 0 {
|
||||
@@ -473,8 +475,9 @@ func Struct2FlatMap(obj interface{}) map[string]interface{} {
|
||||
|
||||
func Struct2MapWithIgnore(obj interface{}, ignoreValues map[string]interface{}) map[string]interface{} {
|
||||
mapData := Struct2FlatMap(obj)
|
||||
for k, v := range mapData {
|
||||
if ignoreValues[k] == v {
|
||||
for k, v := range ignoreValues {
|
||||
// todo 性能考虑?
|
||||
if fmt.Sprint(mapData[k]) == fmt.Sprint(v) {
|
||||
delete(mapData, k)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user