作者 yangfu

fix:1.机会编辑修改

@@ -913,6 +913,27 @@ func CheckChanceDifferent(header *protocol.RequestHeader, chance *models.Chance, @@ -913,6 +913,27 @@ func CheckChanceDifferent(header *protocol.RequestHeader, chance *models.Chance,
913 jsonUnmarshal(chanceData.Speechs, &speechs) 913 jsonUnmarshal(chanceData.Speechs, &speechs)
914 jsonUnmarshal(chanceData.Images, &pictures) 914 jsonUnmarshal(chanceData.Images, &pictures)
915 jsonUnmarshal(chanceData.Videos, &videos) 915 jsonUnmarshal(chanceData.Videos, &videos)
  916 +
  917 + if len(speechs) == 0 {
  918 + speechs = make([]protocol.Speech, 0)
  919 + }
  920 + if len(pictures) == 0 {
  921 + pictures = make([]protocol.Picture, 0)
  922 + }
  923 + if len(videos) == 0 {
  924 + videos = make([]protocol.Video, 0)
  925 + }
  926 +
  927 + if len(request.Speechs) == 0 {
  928 + request.Speechs = make([]protocol.Speech, 0)
  929 + }
  930 + if len(request.Pictures) == 0 {
  931 + request.Pictures = make([]protocol.Picture, 0)
  932 + }
  933 + if len(request.Videos) == 0 {
  934 + request.Videos = make([]protocol.Video, 0)
  935 + }
  936 +
916 if !reflect.DeepEqual(request.Videos, videos) || !reflect.DeepEqual(request.Pictures, pictures) { 937 if !reflect.DeepEqual(request.Videos, videos) || !reflect.DeepEqual(request.Pictures, pictures) {
917 funcCheckSave() 938 funcCheckSave()
918 modifyLog.Videos = request.Videos 939 modifyLog.Videos = request.Videos
@@ -960,6 +981,12 @@ func CheckChanceDifferent(header *protocol.RequestHeader, chance *models.Chance, @@ -960,6 +981,12 @@ func CheckChanceDifferent(header *protocol.RequestHeader, chance *models.Chance,
960 funcDiffForms(chance.SourceContent, request.FormList) //比对表单 981 funcDiffForms(chance.SourceContent, request.FormList) //比对表单
961 funcDiffChanceData() //比对机会数据 982 funcDiffChanceData() //比对机会数据
962 funcFormatEmpty() //格式化变更日志 983 funcFormatEmpty() //格式化变更日志
  984 + //TODO:版本1.3.0以后不需要判断视频/图片 下版本移除视频/图片比较
  985 + if utils.ValidVersion(header.Version, "1.3.0") {
  986 + modifyLog.Pictures = make([]protocol.Picture, 0)
  987 + modifyLog.Videos = make([]protocol.Video, 0)
  988 + modifyLog.RemoveAllPhotoVideo = false
  989 + }
963 if isSaveLog { 990 if isSaveLog {
964 _ = SaveChanceReviseLog(header, chance, modifyLog) 991 _ = SaveChanceReviseLog(header, chance, modifyLog)
965 } 992 }