|
@@ -264,18 +264,23 @@ func DealReportInfo(report *reportService.ReportDTO, isLogin bool, userId int) (
|
|
|
report.IsFree = true
|
|
|
report.IsSubscribe = false
|
|
|
report.IsPackage = false
|
|
|
+ //最热最新的时候使用
|
|
|
+ report.Show = true
|
|
|
} else {
|
|
|
report.Price = packageList[0].Price
|
|
|
report.IsFree = false
|
|
|
report.IsSubscribe = false
|
|
|
report.IsPackage = true
|
|
|
report.ProductId = packageList[0].Id
|
|
|
+ //最热最新的时候使用
|
|
|
+ report.Show = packageList[0].SaleStatus == "on_sale"
|
|
|
}
|
|
|
} else {
|
|
|
report.Price = product.Price
|
|
|
report.IsFree = false
|
|
|
report.ProductId = product.Id
|
|
|
report.IsPackage = false
|
|
|
+ report.Show = product.SaleStatus == "on_sale"
|
|
|
}
|
|
|
if isLogin {
|
|
|
var productIds []int
|
|
@@ -379,12 +384,16 @@ func GetRandedReportByWeeklyHot(limit int, isLogin bool, userId int, pdRiskLevel
|
|
|
continue
|
|
|
}
|
|
|
|
|
|
- if pdRiskNum <= reRiskNum {
|
|
|
+ if pdRiskNum <= reRiskNum && report.Show {
|
|
|
filterList = append(filterList, report)
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
- filterList = dtoList
|
|
|
+ for _, report := range dtoList {
|
|
|
+ if report.Show {
|
|
|
+ filterList = append(filterList, report)
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
reports = make([]HotRankedReport, len(ids))
|
|
|
for i := 0; i < len(filterList); i++ {
|
|
@@ -429,12 +438,16 @@ func GetRandedReportByPublishTimeWeekly(limit int, week bool, isLogin bool, user
|
|
|
logger.Error("解析风险等级失败:%v", err)
|
|
|
continue
|
|
|
}
|
|
|
- if pdRiskNum <= reRiskNum {
|
|
|
+ if pdRiskNum <= reRiskNum && report.Show {
|
|
|
filterList = append(filterList, report)
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
- filterList = dtoList
|
|
|
+ for _, report := range dtoList {
|
|
|
+ if report.Show {
|
|
|
+ filterList = append(filterList, report)
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
reports = convertToPublishRankedReportList(filterList)
|
|
|
return
|