|
@@ -4,6 +4,8 @@ import (
|
|
|
"github.com/beego/beego/v2/client/orm"
|
|
|
"github.com/rdlucklib/rdluck_tools/paging"
|
|
|
"strconv"
|
|
|
+ "time"
|
|
|
+
|
|
|
//"github.com/rdlucklib/rdluck_tools/paging"
|
|
|
)
|
|
|
|
|
@@ -934,7 +936,7 @@ type IndustrialReadNum struct {
|
|
|
}
|
|
|
|
|
|
//获取该产业下文章的用户阅读次数-小红点用
|
|
|
-func GetReportIndustrialReadNumList(userId int, industrialIds string) (items []*IndustrialReadNum, err error) {
|
|
|
+func GetReportIndustrialReadNumList(userId int, industrialIds string, createtime time.Time) (items []*IndustrialReadNum, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
sql := `SELECT a.industrial_management_id, MIN(a.readnum) AS readnum FROM (
|
|
|
SELECT man_g.industrial_management_id,( SELECT COUNT( 1 ) FROM cygx_article_history_record AS rec WHERE rec.user_id = ` + strconv.Itoa(userId) + ` AND rec.article_id = a.article_id ) AS readnum
|
|
@@ -945,8 +947,9 @@ WHERE
|
|
|
a.publish_status = 1
|
|
|
AND a.is_class = 1
|
|
|
AND man_g.industrial_management_id IN (` + industrialIds + `)
|
|
|
+ AND a.publish_date > ?
|
|
|
GROUP BY a.article_id ORDER BY publish_date DESC
|
|
|
) AS a GROUP BY industrial_management_id`
|
|
|
- _, err = o.Raw(sql).QueryRows(&items)
|
|
|
+ _, err = o.Raw(sql, createtime).QueryRows(&items)
|
|
|
return
|
|
|
}
|