|
@@ -402,6 +402,7 @@ func (this *MobileReportController) ArticleCategoryList() {
|
|
|
// @Param PageSize query int true "每页数据条数"
|
|
|
// @Param CurrentIndex query int true "当前页页码,从1开始"
|
|
|
// @Param CategoryId query int true "分类ID"
|
|
|
+// @Param IndustrialManagementId query int false "产业ID"
|
|
|
// @Success 200 {object} models.TacticsListResp
|
|
|
// @router /articleList/byCategoryId [get]
|
|
|
func (this *MobileReportController) List() {
|
|
@@ -420,6 +421,7 @@ func (this *MobileReportController) List() {
|
|
|
pageSize, _ := this.GetInt("PageSize")
|
|
|
currentIndex, _ := this.GetInt("CurrentIndex")
|
|
|
categoryId, _ := this.GetInt("CategoryId")
|
|
|
+ industrialManagementId, _ := this.GetInt("IndustrialManagementId")
|
|
|
|
|
|
var startSize int
|
|
|
if pageSize <= 0 {
|
|
@@ -480,6 +482,21 @@ func (this *MobileReportController) List() {
|
|
|
condition += ` AND category_id_two=? `
|
|
|
pars = append(pars, categoryId)
|
|
|
|
|
|
+ if industrialManagementId > 0 {
|
|
|
+ industrialManageentList, err := models.GetIndustrialArticleGroupManagementByIndustrialManagementId(industrialManagementId)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取信息失败"
|
|
|
+ br.Msg = "获取产业关联的文章ID失败,GetIndustrialArticleGroupManagementByIndustrialManagementIdErr:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ articleIdList := make([]string, 0)
|
|
|
+ for _, v := range industrialManageentList {
|
|
|
+ articleIdList = append(articleIdList, strconv.Itoa(v.ArticleId))
|
|
|
+ }
|
|
|
+ condition += ` AND a.article_id IN ( ` + utils.GetOrmInReplace(len(articleIdList)) + ` ) `
|
|
|
+ pars = append(pars, articleIdList)
|
|
|
+ }
|
|
|
+
|
|
|
total, err = models.GetHomeCount(condition, pars)
|
|
|
if err != nil {
|
|
|
br.Msg = "获取信息失败"
|