|
@@ -8,6 +8,13 @@ type ReportMapping struct {
|
|
|
IsRed bool `description:"是否标红"`
|
|
|
}
|
|
|
|
|
|
+type ReportMappingHome struct {
|
|
|
+ CategoryId int `description:"分类ID"`
|
|
|
+ SubCategoryName string `description:"权限名称"`
|
|
|
+ IsRed bool `description:"是否标红"`
|
|
|
+ Readnum int `description:"阅读数量"`
|
|
|
+}
|
|
|
+
|
|
|
type TradeReportMapping struct {
|
|
|
CategoryId int `description:"分类ID"`
|
|
|
SubCategoryName string `description:"权限名称"`
|
|
@@ -20,6 +27,10 @@ type ReportMappingResp struct {
|
|
|
List []*ReportMapping
|
|
|
}
|
|
|
|
|
|
+type ReportMappingHomeResp struct {
|
|
|
+ List []*ReportMappingHome
|
|
|
+}
|
|
|
+
|
|
|
type TradeReportMappingResp struct {
|
|
|
List []*TradeReportMapping
|
|
|
}
|
|
@@ -32,6 +43,25 @@ func GetReportMappingStrategyAll() (items []*ReportMapping, err error) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+//获取策略下面的所有分类
|
|
|
+func GetReportMappingStrategyHomeAll(uid int) (items []*ReportMappingHome, err error) {
|
|
|
+ o := orm.NewOrm()
|
|
|
+ sql := `SELECT
|
|
|
+ re.category_id,re.sub_category_name, ( SELECT COUNT( 1 ) FROM cygx_article_history_record AS rec WHERE rec.user_id = ? AND rec.article_id = art.article_id ) AS readnum
|
|
|
+FROM
|
|
|
+ cygx_report_mapping AS re
|
|
|
+ INNER JOIN cygx_article AS art ON art.category_id = re.category_id
|
|
|
+WHERE
|
|
|
+ re.report_type = 1
|
|
|
+ AND re.chart_permission_id = 23
|
|
|
+GROUP BY
|
|
|
+ re.match_type_name
|
|
|
+ORDER BY
|
|
|
+ sort DESC , art.publish_date DESC`
|
|
|
+ _, err = o.Raw(sql, uid).QueryRows(&items)
|
|
|
+ return
|
|
|
+}
|
|
|
+
|
|
|
//行业列表
|
|
|
func GetTradeAll(uid, ChartPermissionId int) (items []*TradeReportMapping, err error) {
|
|
|
o := orm.NewOrm()
|