- mark store sku bind as modified when change storevendor price percentage

This commit is contained in:
gazebo
2018-11-19 20:49:18 +08:00
parent aa75705d95
commit bc9f801d2d
4 changed files with 44 additions and 25 deletions

View File

@@ -301,7 +301,7 @@ func Struct2FlatMap(obj interface{}) map[string]interface{} {
}
// todo 这里看是否需要将key值转换成标准格式即字母大写因为beego orm不区分不转换也可以
func FilterMapByStructObject(mapData map[string]interface{}, obj interface{}, excludedFields []string) (valid map[string]interface{}, invalid map[string]interface{}) {
func FilterMapByStructObject(mapData map[string]interface{}, obj interface{}, excludedFields []string, isCheckValue bool) (valid map[string]interface{}, invalid map[string]interface{}) {
excludedMap := make(map[string]int)
for _, v := range excludedFields {
excludedMap[v] = 1
@@ -310,7 +310,7 @@ func FilterMapByStructObject(mapData map[string]interface{}, obj interface{}, ex
valid = make(map[string]interface{})
invalid = make(map[string]interface{})
for k, v := range mapData {
if m[k] != nil && excludedMap[k] == 0 && v != nil {
if m[k] != nil && excludedMap[k] == 0 && v != nil && (!isCheckValue || m[k] != v) {
valid[k] = v
} else {
invalid[k] = v