正在显示
1 个修改的文件
包含
4 行增加
和
1 行删除
@@ -746,13 +746,16 @@ func CheckChanceDifferent(header *protocol.RequestHeader, chance *models.Chance, | @@ -746,13 +746,16 @@ func CheckChanceDifferent(header *protocol.RequestHeader, chance *models.Chance, | ||
746 | reviseContents []protocol.ReviseContent | 746 | reviseContents []protocol.ReviseContent |
747 | ) | 747 | ) |
748 | jsonUnmarshal(source, &src) | 748 | jsonUnmarshal(source, &src) |
749 | + keyFunc := func(form *protocol.Form) string { | ||
750 | + return fmt.Sprintf("%v_%v", form.Label, form.SectionType) | ||
751 | + } | ||
749 | for i := range src { | 752 | for i := range src { |
750 | mapForm[src[i].Label] = src[i] | 753 | mapForm[src[i].Label] = src[i] |
751 | } | 754 | } |
752 | for i := range dis { | 755 | for i := range dis { |
753 | isDiff := false | 756 | isDiff := false |
754 | srcValue := "" | 757 | srcValue := "" |
755 | - if v, ok := mapForm[dis[i].Label]; ok { | 758 | + if v, ok := mapForm[keyFunc(dis[i])]; ok { |
756 | srcValue = v.Value | 759 | srcValue = v.Value |
757 | if dis[i].Value != v.Value { | 760 | if dis[i].Value != v.Value { |
758 | isDiff = true | 761 | isDiff = true |
-
请 注册 或 登录 后发表评论