|
@@ -47,7 +47,7 @@ type TradeReportMappingResp struct {
|
|
|
List []*TradeReportMapping
|
|
|
}
|
|
|
|
|
|
-//获取所有分类
|
|
|
+// 获取所有分类
|
|
|
func GetReportMappingStrategyAll() (items []*ReportMapping, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
sql := `SELECT * FROM cygx_report_mapping WHERE 1=1 ORDER BY sort ASC `
|
|
@@ -55,7 +55,7 @@ func GetReportMappingStrategyAll() (items []*ReportMapping, err error) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//获取策略下面的所有分类
|
|
|
+// 获取策略下面的所有分类
|
|
|
func GetReportMappingStrategyHomeAll() (items []*TradeReportMapping, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
sql := `SELECT
|
|
@@ -75,7 +75,7 @@ ORDER BY
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//行业列表
|
|
|
+// 行业列表
|
|
|
func GetTradeAll(ChartPermissionId int) (items []*TradeReportMapping, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
sql := `SELECT
|
|
@@ -112,7 +112,7 @@ type IndustrialToArticleCategoryListRep struct {
|
|
|
AuthInfo *UserPermissionAuthInfo
|
|
|
}
|
|
|
|
|
|
-//通过分类ID获取详情
|
|
|
+// 通过分类ID获取详情
|
|
|
func GetdetailByCategoryId(categoryId int) (item *ReportMapping, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
sql := `SELECT * FROM cygx_report_mapping WHERE category_id=? LIMIT 1 `
|
|
@@ -120,7 +120,7 @@ func GetdetailByCategoryId(categoryId int) (item *ReportMapping, err error) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//通过分类ID获取详情
|
|
|
+// 通过分类ID获取详情
|
|
|
func GetdetailByCategoryIdPush(categoryId int) (item *ReportMapping, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
sql := `SELECT * FROM cygx_report_mapping WHERE category_id=? `
|
|
@@ -128,7 +128,7 @@ func GetdetailByCategoryIdPush(categoryId int) (item *ReportMapping, err error)
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//通过分类ID获取详情主观客观
|
|
|
+// 通过分类ID获取详情主观客观
|
|
|
func GetdetailByCategoryIdSando(categoryId int) (item *ReportMapping, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
sql := `SELECT * FROM cygx_report_mapping WHERE permission_type>0 AND category_id=? LIMIT 1`
|
|
@@ -136,15 +136,15 @@ func GetdetailByCategoryIdSando(categoryId int) (item *ReportMapping, err error)
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//通过分类ID获取详情
|
|
|
-func GetdetailByCategoryIdOne(categoryId int) (item *ReportMapping, err error) {
|
|
|
+// 通过分类ID获取详情
|
|
|
+func GetdetailByCategoryIdOne(categoryId, reportType int) (item *ReportMapping, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
- sql := `SELECT * FROM cygx_report_mapping WHERE category_id=? LIMIT 1`
|
|
|
- err = o.Raw(sql, categoryId).QueryRow(&item)
|
|
|
+ sql := `SELECT * FROM cygx_report_mapping WHERE category_id=? AND report_type = ? LIMIT 1`
|
|
|
+ err = o.Raw(sql, categoryId, reportType).QueryRow(&item)
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//通过分类ID获取详情
|
|
|
+// 通过分类ID获取详情
|
|
|
func GetdetailByCategoryIdSet(categoryId int) (ids string, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
sql := `SELECT
|
|
@@ -157,7 +157,7 @@ func GetdetailByCategoryIdSet(categoryId int) (ids string, err error) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//判断该分类下最新的文章用户是否阅读
|
|
|
+// 判断该分类下最新的文章用户是否阅读
|
|
|
func CheckThisCategoryNewArticleIsRead(uid, categoryId int) (count int, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
sql := `SELECT COUNT(1) count
|
|
@@ -168,7 +168,7 @@ func CheckThisCategoryNewArticleIsRead(uid, categoryId int) (count int, err erro
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//获取策略下面的所有分类
|
|
|
+// 获取策略下面的所有分类
|
|
|
func GetMatchTypeNamenNotNull() (items []*ReportMapping, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
sql := `SELECT category_id,match_type_name FROM cygx_report_mapping WHERE match_type_name <> ''`
|