@@ -118,18 +118,21 @@ func GetByTypeIdsAndReportIds(typeIds []int, reportIds []int, classifyNameFirst
func GetWeekRecommendList(reportId int, firstName string) (items []*ReportChapter, err error) {
sql := `SELECT * FROM (SELECT
- report_id,
- report_chapter_id,
- classify_name_first,
- title,
- stage,
- publish_time
+ a.report_id,
+ a.report_chapter_id,
+ a.classify_name_first,
+ a.title,
+ a.stage,
+ a.publish_time
FROM
- report_chapter
+ report_chapter AS a,
+ report AS b
WHERE
- publish_state = 2
- AND report_id <> %v
- AND classify_name_first = "%v"
+ a.publish_state = 2
+ AND a.report_id <> %v
+ AND a.classify_name_first = "%v"
+ AND a.report_id=b.id
+ AND b.state = 2
ORDER BY
publish_time DESC) t
GROUP BY report_id