|
@@ -1847,6 +1847,7 @@ func (this *ReportController) IndustryAndArticleList() {
|
|
// @Title 产业报告分类关联作者列表接口Pc端
|
|
// @Title 产业报告分类关联作者列表接口Pc端
|
|
// @Description 获取产业报告分类关联作者列表接口Pc端
|
|
// @Description 获取产业报告分类关联作者列表接口Pc端
|
|
// @Param ChartPermissionId query int true "分类ID"
|
|
// @Param ChartPermissionId query int true "分类ID"
|
|
|
|
+// @Param KeyWord query string true "搜索关键词"
|
|
// @Param PageSize query int true "每页数据条数"
|
|
// @Param PageSize query int true "每页数据条数"
|
|
// @Param CurrentIndex query int true "当前页页码,从1开始"
|
|
// @Param CurrentIndex query int true "当前页页码,从1开始"
|
|
// @Success 200 {object} models.CygxArticleDepartmentListPc
|
|
// @Success 200 {object} models.CygxArticleDepartmentListPc
|
|
@@ -1867,16 +1868,42 @@ func (this *ReportController) IndustryListByDepartmentPc() {
|
|
pageSize, _ := this.GetInt("PageSize")
|
|
pageSize, _ := this.GetInt("PageSize")
|
|
currentIndex, _ := this.GetInt("CurrentIndex")
|
|
currentIndex, _ := this.GetInt("CurrentIndex")
|
|
chartPermissionId, _ := this.GetInt("ChartPermissionId")
|
|
chartPermissionId, _ := this.GetInt("ChartPermissionId")
|
|
|
|
+ keyWord := this.GetString("KeyWord")
|
|
var startSize int
|
|
var startSize int
|
|
var condition string
|
|
var condition string
|
|
condition = ` AND a.publish_status=1 AND m.chart_permission_id =` + strconv.Itoa(chartPermissionId)
|
|
condition = ` AND a.publish_status=1 AND m.chart_permission_id =` + strconv.Itoa(chartPermissionId)
|
|
- //condition = ` AND a.publish_status=1 `
|
|
|
|
if pageSize <= 0 {
|
|
if pageSize <= 0 {
|
|
pageSize = utils.PageSize20
|
|
pageSize = utils.PageSize20
|
|
}
|
|
}
|
|
if currentIndex <= 0 {
|
|
if currentIndex <= 0 {
|
|
currentIndex = 1
|
|
currentIndex = 1
|
|
}
|
|
}
|
|
|
|
+ var articleIdGroup string
|
|
|
|
+ if keyWord != "" {
|
|
|
|
+ articleIdSub, err := models.GetArticleIdSubjectGroup(keyWord)
|
|
|
|
+ if err != nil {
|
|
|
|
+ br.Msg = "获取信息失败"
|
|
|
|
+ br.ErrMsg = "获取标的信息失败,Err:" + err.Error()
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ articleIdInd, err := models.GetArticleIndustrialIdGroup(keyWord)
|
|
|
|
+ if err != nil {
|
|
|
|
+ br.Msg = "获取信息失败"
|
|
|
|
+ br.ErrMsg = "获取产业信息失败,Err:" + err.Error()
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if articleIdSub != "" && articleIdInd != "" {
|
|
|
|
+ articleIdGroup = articleIdSub + "," + articleIdInd
|
|
|
|
+ } else if articleIdSub != "" && articleIdInd == "" {
|
|
|
|
+ articleIdGroup = articleIdSub
|
|
|
|
+ } else if articleIdSub == "" && articleIdInd == "" {
|
|
|
|
+ articleIdGroup = articleIdInd
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if articleIdGroup != "" {
|
|
|
|
+ condition += ` AND a.article_id IN (` + articleIdGroup + `)`
|
|
|
|
+ }
|
|
startSize = paging.StartIndex(currentIndex, pageSize)
|
|
startSize = paging.StartIndex(currentIndex, pageSize)
|
|
total, err := models.GetArticleDepartmentCount(condition)
|
|
total, err := models.GetArticleDepartmentCount(condition)
|
|
page := paging.GetPaging(currentIndex, pageSize, total)
|
|
page := paging.GetPaging(currentIndex, pageSize, total)
|
|
@@ -1904,7 +1931,7 @@ func (this *ReportController) IndustryListByDepartmentPc() {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
for k, v := range list {
|
|
for k, v := range list {
|
|
- artList, err := models.GetArticleByDepartmentIdPc(v.DepartmentId)
|
|
|
|
|
|
+ artList, err := models.GetArticleByDepartmentIdPc(v.DepartmentId, articleIdGroup)
|
|
if err != nil {
|
|
if err != nil {
|
|
br.Msg = "获取信息失败"
|
|
br.Msg = "获取信息失败"
|
|
br.ErrMsg = "获取文章信息失败,Err:" + err.Error()
|
|
br.ErrMsg = "获取文章信息失败,Err:" + err.Error()
|