作者 yangfu

榜单修改

... ... @@ -93,7 +93,7 @@ func GetRankPeriods(companyId int, rankTypeId int, status []int) (v []*RankPerio
if len(status) > 0 {
sql.Where(fmt.Sprintf("status in (%v)", utils.JoinInts(status, ",")))
}
sql.Order("begin_time")
sql.Order("end_time")
_, err = sql.Querys(&v)
return
}
... ...
... ... @@ -778,12 +778,9 @@ func CheckChanceDifferent(header *protocol.RequestHeader, chance *models.Chance,
jsonUnmarshal(chanceData.Speechs, &speechs)
jsonUnmarshal(chanceData.Images, &pictures)
jsonUnmarshal(chanceData.Videos, &videos)
if !reflect.DeepEqual(request.Videos, videos) {
if !reflect.DeepEqual(request.Videos, videos) || !reflect.DeepEqual(request.Pictures, pictures) {
checkIsSaveLog()
modifyLog.Videos = request.Videos
}
if !reflect.DeepEqual(request.Pictures, pictures) {
checkIsSaveLog()
modifyLog.Pictures = request.Pictures
}
if !reflect.DeepEqual(request.Speechs, speechs) {
... ... @@ -794,13 +791,12 @@ func CheckChanceDifferent(header *protocol.RequestHeader, chance *models.Chance,
if (len(videos) > 0 && len(request.Videos) == 0) && len(pictures) > 0 && len(request.Pictures) == 0 {
modifyLog.RemoveAllPhotoVideo = true
}
if (len(videos) > 0 && len(request.Videos) == 0) && len(pictures) == 0 && len(request.Pictures) == 0 {
if (len(videos) > 0 && len(request.Videos) == 0) && len(pictures) == len(request.Pictures) {
modifyLog.RemoveAllPhotoVideo = true
}
if (len(videos) == 0 && len(request.Videos) == 0) && len(pictures) > 0 && len(request.Pictures) == 0 {
if (len(videos) == len(request.Videos)) && len(pictures) > 0 && len(request.Pictures) == 0 {
modifyLog.RemoveAllPhotoVideo = true
}
if len(speechs) > 0 && len(request.Speechs) == 0 {
modifyLog.RemoveAllSpeech = true
}
... ...
... ... @@ -187,7 +187,7 @@ func GetRankRange(header *protocol.RequestHeader, request *protocol.GetRankRange
Id: lists[i].Id,
Name: lists[i].Name,
}
if lists[i].Type == protocol.RankRangeTypeAllCompanyDepartment || lists[i].Type == protocol.RankRangeTypeAllCompanyDepartment {
if lists[i].Type == protocol.RankRangeTypeAllCompanyDepartment || lists[i].Type == protocol.RankRangeTypeAllSpecifyDepartment {
item.Type = protocol.RankRangeTypeDepartment
} else {
item.Type = protocol.RankRangeTypeUser
... ...