- 添加了部分到家订单级促销

This commit is contained in:
gazebo
2019-04-04 21:03:10 +08:00
parent ef69a4f60d
commit c3e3c32d44
14 changed files with 294 additions and 107 deletions

View File

@@ -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)
}
}