|
@@ -45,19 +45,22 @@ func GetReportDailyListCount() (count int, err error) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+// func GetReportDailyList(startSize, pageSize int) (items []*ReportList, err error) {
|
|
|
+// o := orm.NewOrmUsingDB("rddp")
|
|
|
+// sql := ` SELECT a.id,a.add_type,a.classify_id_first,a.classify_name_first,a.classify_id_second,a.classify_name_second,a.title,a.abstract,a.author,a.frequency,
|
|
|
+// a.create_time,a.modify_time,a.state,a.publish_time,a.stage,a.msg_is_send,b.id AS classify_id,b.classify_name,b.descript,b.report_author,b.author_descript,
|
|
|
+// b.report_img_url,b.head_img_url,b.avatar_img_url,b.column_img_url,a.video_url,a.video_name,a.video_play_seconds,a.video_size,
|
|
|
+// CASE WHEN DATE(a.publish_time)=DATE(NOW()) THEN 1 ELSE 0 END AS is_current_date
|
|
|
+// FROM report AS a
|
|
|
+// INNER JOIN classify AS b ON a.classify_id_second=b.id
|
|
|
+// WHERE (a.state=2 OR a.state=6) AND DATE(a.publish_time)=DATE(NOW())
|
|
|
+// ORDER BY a.publish_time DESC LIMIT ?,? `
|
|
|
+// _, err = o.Raw(sql, startSize, pageSize).QueryRows(&items)
|
|
|
+// return
|
|
|
+// }
|
|
|
func GetReportDailyList(startSize, pageSize int) (items []*ReportList, err error) {
|
|
|
o := orm.NewOrmUsingDB("rddp")
|
|
|
- sql := ` SELECT a.id,a.add_type,a.classify_id_first,a.classify_name_first,a.classify_id_second,a.classify_name_second,a.title,a.abstract,a.author,a.frequency,
|
|
|
- a.create_time,a.modify_time,a.state,a.publish_time,a.stage,a.msg_is_send,b.id AS classify_id,b.classify_name,b.descript,b.report_author,b.author_descript,
|
|
|
- b.report_img_url,b.head_img_url,b.avatar_img_url,b.column_img_url,a.video_url,a.video_name,a.video_play_seconds,a.video_size,
|
|
|
- CASE WHEN DATE(a.publish_time)=DATE(NOW()) THEN 1 ELSE 0 END AS is_current_date
|
|
|
- FROM report AS a
|
|
|
- INNER JOIN classify AS b ON a.classify_id_second=b.id
|
|
|
- WHERE (a.state=2 OR a.state=6) AND DATE(a.publish_time)=DATE(NOW()) AND a.classify_id_second IN (
|
|
|
- SELECT DISTINCT classify_id
|
|
|
- FROM chart_permission_search_key_word_mapping
|
|
|
- )
|
|
|
- ORDER BY a.publish_time DESC LIMIT ?,? `
|
|
|
+ sql := ` SELECT * FROM report WHERE (state=2 OR state=6) AND DATE(publish_time)=DATE(NOW()) ORDER BY publish_time DESC LIMIT ?,? `
|
|
|
_, err = o.Raw(sql, startSize, pageSize).QueryRows(&items)
|
|
|
return
|
|
|
}
|
|
@@ -76,17 +79,7 @@ func GetReportRecentListCount() (count int, err error) {
|
|
|
|
|
|
func GetReportRecentList(startSize, pageSize int) (items []*ReportList, err error) {
|
|
|
o := orm.NewOrmUsingDB("rddp")
|
|
|
- sql := ` SELECT a.id,a.add_type,a.classify_id_first,a.classify_name_first,a.classify_id_second,a.classify_name_second,a.title,a.abstract,a.author,a.frequency,
|
|
|
- a.create_time,a.modify_time,a.state,a.publish_time,a.stage,a.msg_is_send,b.id AS classify_id,b.classify_name,b.descript,b.report_author,b.author_descript,
|
|
|
- b.report_img_url,b.head_img_url,b.avatar_img_url,b.column_img_url,a.video_url,a.video_name,a.video_play_seconds,a.video_size,
|
|
|
- CASE WHEN DATE(a.publish_time)=DATE(NOW()) THEN 1 ELSE 0 END AS is_current_date
|
|
|
- FROM report AS a
|
|
|
- INNER JOIN classify AS b ON a.classify_id_second=b.id
|
|
|
- WHERE (a.state=2 OR a.state=6) AND a.classify_id_second IN (
|
|
|
- SELECT DISTINCT classify_id
|
|
|
- FROM chart_permission_search_key_word_mapping
|
|
|
- )
|
|
|
- ORDER BY a.publish_time DESC LIMIT ?,? `
|
|
|
+ sql := ` SELECT * FROM report WHERE (state=2 OR state=6) ORDER BY publish_time DESC LIMIT ?,? `
|
|
|
_, err = o.Raw(sql, startSize, pageSize).QueryRows(&items)
|
|
|
return
|
|
|
}
|