zhangchuanxing преди 1 седмица
родител
ревизия
564ca2f5bd
променени са 2 файла, в които са добавени 33 реда и са изтрити 8 реда
  1. 21 8
      controllers/report.go
  2. 12 0
      models/zhouqi_article_map.go

+ 21 - 8
controllers/report.go

@@ -2317,8 +2317,14 @@ func (this *MobileReportController) ZhouqiTacticsList() {
 	}
 	startSize = paging.StartIndex(currentIndex, pageSize)
 
+	detail, err := models.GetCygxZhouqiArticleMapInfoById(categoryId)
+	if err != nil {
+		br.Msg = "获取信息失败"
+		br.ErrMsg = "获取信息失败,Err:" + err.Error()
+		return
+	}
 	var total int
-	var err error
+	//var err error
 	resp := new(models.TacticsListResp)
 	page := paging.GetPaging(currentIndex, pageSize, total)
 	list := make([]*models.ArticleListResp, 0)
@@ -2334,20 +2340,27 @@ func (this *MobileReportController) ZhouqiTacticsList() {
 		if v.MatchTypeName != "" {
 			matchTypeName = append(matchTypeName, v.MatchTypeName)
 		}
-
 		if v.SeriesName != "" {
 			seriesName = append(seriesName, v.SeriesName)
 		}
 	}
 
-	var condition string
-	//var pars []interface{}
-	if len(seriesName) == 0 {
-		condition = " AND field_name  IN  ('" + strings.Join(matchTypeName, "','") + "')"
-	} else {
-		condition = " AND  ( field_name  IN  ('" + strings.Join(matchTypeName, "','") + "')   OR series_name IN  ('" + strings.Join(seriesName, "','") + "')   )"
+	var conditionOr string
+	if detail.FiccReportId != "" {
+		conditionOr = " OR  art.report_id  IN (" + detail.FiccReportId + ")" // 手动配置报告展示逻辑处理
+	}
+	if len(seriesName) > 0 {
+		conditionOr += "  OR series_name IN  ('" + strings.Join(seriesName, "','") + "') "
 	}
 
+	var condition string
+	//var pars []interface{}
+	//if len(seriesName) == 0 {
+	//	condition = " AND field_name  IN  ('" + strings.Join(matchTypeName, "','") + "')"
+	//} else {
+	//	condition = " AND  ( field_name  IN  ('" + strings.Join(matchTypeName, "','") + "')   OR series_name IN  ('" + strings.Join(seriesName, "','") + "')   )"
+	//}
+	condition = " AND  ( field_name  IN  ('" + strings.Join(matchTypeName, "','") + "')  " + conditionOr + " ) "
 	list, total, err = models.GetReportAndproductIndustrylListimgZhouqi(condition, startSize, pageSize)
 	if err != nil {
 		br.Msg = "获取信息失败"

+ 12 - 0
models/zhouqi_article_map.go

@@ -11,6 +11,10 @@ type CygxZhouqiArticleMap struct {
 	ArticleUpdateTime string `description:"对应文章的更新时间"`
 }
 
+type CygxZhouqiArticleDetail struct {
+	FiccReportId string `description:"Ficc研报单一篇报告,多个地方展示配置项"`
+}
+
 // 获取周期下面的一级分类
 func GetCygxZhouqiArticleMapFirst() (items []*CygxZhouqiArticleMap, err error) {
 	o := orm.NewOrm()
@@ -45,3 +49,11 @@ func GetCygxZhouqiArticleMapByParentId(parentId int) (items []*CygxZhouqiArticle
 	_, err = o.Raw(sql, parentId).QueryRows(&items)
 	return
 }
+
+// 通过纪要ID获取详情
+func GetCygxZhouqiArticleMapInfoById(categoryId int) (item *CygxZhouqiArticleDetail, err error) {
+	o := orm.NewOrm()
+	sql := `SELECT * FROM cygx_zhouqi_article_map  WHERE category_id=?  `
+	err = o.Raw(sql, categoryId).QueryRow(&item)
+	return
+}