zhangchuanxing 4 nedēļas atpakaļ
vecāks
revīzija
3f5a2e9784
2 mainītis faili ar 33 papildinājumiem un 8 dzēšanām
  1. 21 8
      controllers/report.go
  2. 12 0
      models/zhouqi_article_map.go

+ 21 - 8
controllers/report.go

@@ -4013,9 +4013,14 @@ func (this *ReportController) ZhouqiTacticsList() {
 		currentIndex = 1
 	}
 	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.TacticsListZhouqiResp)
 	page := paging.GetPaging(currentIndex, pageSize, total)
 	list := make([]*models.HomeArticle, 0)
@@ -4037,14 +4042,22 @@ func (this *ReportController) ZhouqiTacticsList() {
 		}
 	}
 
-	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

@@ -12,6 +12,10 @@ type CygxZhouqiArticleMap struct {
 	ArticleUpdateTime string `description:"对应文章的更新时间"`
 }
 
+type CygxZhouqiArticleDetail struct {
+	FiccReportId string `description:"Ficc研报单一篇报告,多个地方展示配置项"`
+}
+
 // 获取周期下面的一级分类
 func GetCygxZhouqiArticleMapFirst() (items []*CygxZhouqiArticleMap, err error) {
 	o := orm.NewOrm()
@@ -65,3 +69,11 @@ func UpdateCygxZhouqiArticleMapTime(articleUpdateTime string, categoryId int) (e
 	_, err = o.Raw(sql, articleUpdateTime, categoryId).Exec()
 	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
+}