作者 yangfu

榜单修改

@@ -93,7 +93,7 @@ func GetRankPeriods(companyId int, rankTypeId int, status []int) (v []*RankPerio @@ -93,7 +93,7 @@ func GetRankPeriods(companyId int, rankTypeId int, status []int) (v []*RankPerio
93 if len(status) > 0 { 93 if len(status) > 0 {
94 sql.Where(fmt.Sprintf("status in (%v)", utils.JoinInts(status, ","))) 94 sql.Where(fmt.Sprintf("status in (%v)", utils.JoinInts(status, ",")))
95 } 95 }
96 - sql.Order("begin_time") 96 + sql.Order("end_time")
97 _, err = sql.Querys(&v) 97 _, err = sql.Querys(&v)
98 return 98 return
99 } 99 }
@@ -778,12 +778,9 @@ func CheckChanceDifferent(header *protocol.RequestHeader, chance *models.Chance, @@ -778,12 +778,9 @@ func CheckChanceDifferent(header *protocol.RequestHeader, chance *models.Chance,
778 jsonUnmarshal(chanceData.Speechs, &speechs) 778 jsonUnmarshal(chanceData.Speechs, &speechs)
779 jsonUnmarshal(chanceData.Images, &pictures) 779 jsonUnmarshal(chanceData.Images, &pictures)
780 jsonUnmarshal(chanceData.Videos, &videos) 780 jsonUnmarshal(chanceData.Videos, &videos)
781 - if !reflect.DeepEqual(request.Videos, videos) { 781 + if !reflect.DeepEqual(request.Videos, videos) || !reflect.DeepEqual(request.Pictures, pictures) {
782 checkIsSaveLog() 782 checkIsSaveLog()
783 modifyLog.Videos = request.Videos 783 modifyLog.Videos = request.Videos
784 - }  
785 - if !reflect.DeepEqual(request.Pictures, pictures) {  
786 - checkIsSaveLog()  
787 modifyLog.Pictures = request.Pictures 784 modifyLog.Pictures = request.Pictures
788 } 785 }
789 if !reflect.DeepEqual(request.Speechs, speechs) { 786 if !reflect.DeepEqual(request.Speechs, speechs) {
@@ -794,13 +791,12 @@ func CheckChanceDifferent(header *protocol.RequestHeader, chance *models.Chance, @@ -794,13 +791,12 @@ func CheckChanceDifferent(header *protocol.RequestHeader, chance *models.Chance,
794 if (len(videos) > 0 && len(request.Videos) == 0) && len(pictures) > 0 && len(request.Pictures) == 0 { 791 if (len(videos) > 0 && len(request.Videos) == 0) && len(pictures) > 0 && len(request.Pictures) == 0 {
795 modifyLog.RemoveAllPhotoVideo = true 792 modifyLog.RemoveAllPhotoVideo = true
796 } 793 }
797 - if (len(videos) > 0 && len(request.Videos) == 0) && len(pictures) == 0 && len(request.Pictures) == 0 { 794 + if (len(videos) > 0 && len(request.Videos) == 0) && len(pictures) == len(request.Pictures) {
798 modifyLog.RemoveAllPhotoVideo = true 795 modifyLog.RemoveAllPhotoVideo = true
799 } 796 }
800 - if (len(videos) == 0 && len(request.Videos) == 0) && len(pictures) > 0 && len(request.Pictures) == 0 { 797 + if (len(videos) == len(request.Videos)) && len(pictures) > 0 && len(request.Pictures) == 0 {
801 modifyLog.RemoveAllPhotoVideo = true 798 modifyLog.RemoveAllPhotoVideo = true
802 } 799 }
803 -  
804 if len(speechs) > 0 && len(request.Speechs) == 0 { 800 if len(speechs) > 0 && len(request.Speechs) == 0 {
805 modifyLog.RemoveAllSpeech = true 801 modifyLog.RemoveAllSpeech = true
806 } 802 }
@@ -187,7 +187,7 @@ func GetRankRange(header *protocol.RequestHeader, request *protocol.GetRankRange @@ -187,7 +187,7 @@ func GetRankRange(header *protocol.RequestHeader, request *protocol.GetRankRange
187 Id: lists[i].Id, 187 Id: lists[i].Id,
188 Name: lists[i].Name, 188 Name: lists[i].Name,
189 } 189 }
190 - if lists[i].Type == protocol.RankRangeTypeAllCompanyDepartment || lists[i].Type == protocol.RankRangeTypeAllCompanyDepartment { 190 + if lists[i].Type == protocol.RankRangeTypeAllCompanyDepartment || lists[i].Type == protocol.RankRangeTypeAllSpecifyDepartment {
191 item.Type = protocol.RankRangeTypeDepartment 191 item.Type = protocol.RankRangeTypeDepartment
192 } else { 192 } else {
193 item.Type = protocol.RankRangeTypeUser 193 item.Type = protocol.RankRangeTypeUser