ziwen 2 年之前
父節點
當前提交
637060eafe
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      models/report.go

+ 1 - 1
models/report.go

@@ -928,7 +928,7 @@ type IndustrialReadNum struct {
 //获取该产业下文章的用户阅读次数-小红点用
 func GetReportIndustrialReadNumList(userId int, industrialIds string) (items []*IndustrialReadNum, err error) {
 	o := orm.NewOrm()
-	sql := `SELECT a.industrial_management_id, SUM(a.readnum) AS readnum FROM (
+	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 
 FROM
 	cygx_article AS a