|
@@ -1685,7 +1685,7 @@ func GetReportListByCollectList(classifyIdFirst, classifyIdSecond, classifyIdThi
|
|
|
return items, err
|
|
|
}
|
|
|
|
|
|
-func GetReportListByCollectCountV2(classifyIdFirst, classifyIdSecond, classifyIdThird []string, keyword, author string, state int) (count int, err error) {
|
|
|
+func GetReportListByCollectCountV2(classifyIdFirst, classifyIdSecond, classifyIdThird, chartPermissionIdList []string, keyword, author string, state int) (count int, err error) {
|
|
|
o := orm.NewOrmUsingDB("rddp")
|
|
|
var params []interface{}
|
|
|
|
|
@@ -1694,9 +1694,16 @@ func GetReportListByCollectCountV2(classifyIdFirst, classifyIdSecond, classifyId
|
|
|
SELECT COUNT(DISTINCT t.id) AS totalCount
|
|
|
FROM (
|
|
|
SELECT b.id
|
|
|
- FROM report AS b
|
|
|
+ FROM report AS b left join chart_permission_search_key_word_mapping c on
|
|
|
+b.classify_id = c.classify_id
|
|
|
WHERE 1 = 1
|
|
|
`
|
|
|
+ if len(chartPermissionIdList) > 0 {
|
|
|
+ sql += ` and c.chart_permission_id in (` + utils.GetOrmInReplace(len(chartPermissionIdList)) + `)`
|
|
|
+ for _, chartPermissionId := range chartPermissionIdList {
|
|
|
+ params = append(params, chartPermissionId)
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
// 处理关键词
|
|
|
if keyword != "" {
|
|
@@ -1750,7 +1757,7 @@ func GetReportListByCollectCountV2(classifyIdFirst, classifyIdSecond, classifyId
|
|
|
return count, err
|
|
|
}
|
|
|
|
|
|
-func GetReportListByCollectListV2(classifyIdFirst, classifyIdSecond, classifyIdThird []string, keyword, orderField, orderType string, startSize, pageSize int, author string, state int) (items []*ReportList, err error) {
|
|
|
+func GetReportListByCollectListV2(classifyIdFirst, classifyIdSecond, classifyIdThird, chartPermissionIdList []string, keyword, orderField, orderType string, startSize, pageSize int, author string, state int) (items []*ReportList, err error) {
|
|
|
o := orm.NewOrmUsingDB("rddp")
|
|
|
var params []interface{}
|
|
|
|
|
@@ -1759,7 +1766,8 @@ func GetReportListByCollectListV2(classifyIdFirst, classifyIdSecond, classifyIdT
|
|
|
SELECT DISTINCT t.id, t.title, t.author, t.modify_time, t.publish_time,t.classify_id_first,t.classify_name_first,t.classify_id_second,t.classify_name_second,t.classify_id_third,t.classify_name_third
|
|
|
FROM (
|
|
|
SELECT b.id, b.title, b.author, b.modify_time, b.publish_time,b.classify_id_first,b.classify_name_first,b.classify_id_second,b.classify_name_second,b.classify_id_third,b.classify_name_third
|
|
|
- FROM report AS b
|
|
|
+ FROM report AS b left join chart_permission_search_key_word_mapping c on
|
|
|
+b.classify_id = c.classify_id
|
|
|
WHERE 1 = 1
|
|
|
`
|
|
|
|
|
@@ -1808,6 +1816,13 @@ func GetReportListByCollectListV2(classifyIdFirst, classifyIdSecond, classifyIdT
|
|
|
sql += ` AND (` + strings.Join(classifyIdSqlList, " OR ") + `) `
|
|
|
}
|
|
|
|
|
|
+ if len(chartPermissionIdList) > 0 {
|
|
|
+ sql += ` and c.chart_permission_id in (` + utils.GetOrmInReplace(len(chartPermissionIdList)) + `)`
|
|
|
+ for _, chartPermissionId := range chartPermissionIdList {
|
|
|
+ params = append(params, chartPermissionId)
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
sql += ") AS t "
|
|
|
|
|
|
// 排序处理
|