|
@@ -86,18 +86,19 @@ WHERE
|
|
|
}
|
|
|
|
|
|
//产业下所关联的文章分类列表
|
|
|
-func IndustrialToArticleCategory(industrialManagementId int) (items []*IndustrialToArticleCategoryRep, err error) {
|
|
|
+func IndustrialToArticleCategory(industrialManagementId, chartPermissionId int) (items []*IndustrialToArticleCategoryRep, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
sql := `SELECT map.match_type_name,map.category_id
|
|
|
FROM cygx_report_mapping AS map
|
|
|
INNER JOIN cygx_article AS art ON art.category_id = map.category_id
|
|
|
INNER JOIN cygx_industrial_article_group_management AS man_g ON man_g.article_id = art.article_id
|
|
|
- WHERE map.report_type = 2
|
|
|
+ WHERE map.report_type = 2
|
|
|
AND art.is_report = 1
|
|
|
AND art.publish_status = 1
|
|
|
AND man_g.industrial_management_id =?
|
|
|
+ AND map.chart_permission_id = ?
|
|
|
GROUP BY map.match_type_name`
|
|
|
- _, err = o.Raw(sql, industrialManagementId).QueryRows(&items)
|
|
|
+ _, err = o.Raw(sql, industrialManagementId, chartPermissionId).QueryRows(&items)
|
|
|
return
|
|
|
}
|
|
|
|