瀏覽代碼

no message

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

+ 2 - 2
models/report.go

@@ -57,7 +57,7 @@ WHERE
 	chart_permission_id = any( SELECT chart_permission_id FROM cygx_report_mapping WHERE category_id = ` + strconv.Itoa(categoryId) + ` ) 
 	AND match_type_name = any( SELECT match_type_name FROM cygx_report_mapping WHERE category_id = ` + strconv.Itoa(categoryId) + ` ) )
 	AND a.is_class = 1
-	AND man_g.industrial_management_id = ?`
+	AND man_g.industrial_management_id = ?  GROUP BY a.article_id `
 	err = o.Raw(sql, industrialManagementId).QueryRow(&count)
 	return
 }
@@ -80,7 +80,7 @@ WHERE
 	AND match_type_name = any( SELECT match_type_name FROM cygx_report_mapping WHERE category_id = ` + strconv.Itoa(categoryId) + ` ) )
     AND a.is_class = 1
 	AND man_g.industrial_management_id = ?`
-	sql += ` ORDER BY publish_date DESC LIMIT ?,? `
+	sql += `   GROUP BY a.article_id ORDER BY publish_date DESC LIMIT ?,? `
 	_, err = o.Raw(sql, pars, industrialManagementId, startSize, pageSize).QueryRows(&items)
 	return
 }