zhangchuanxing 4 ヶ月 前
コミット
5dacb2ea5e
2 ファイル変更16 行追加2 行削除
  1. 13 2
      controllers/report.go
  2. 3 0
      models/zhouqi_article_map.go

+ 13 - 2
controllers/report.go

@@ -2329,13 +2329,24 @@ func (this *MobileReportController) ZhouqiTacticsList() {
 		return
 	}
 	var matchTypeName = []string{}
+	var seriesName = []string{}
 	for _, v := range listCategory {
-		matchTypeName = append(matchTypeName, v.MatchTypeName)
+		if v.MatchTypeName != "" {
+			matchTypeName = append(matchTypeName, v.MatchTypeName)
+		}
+
+		if v.SeriesName != "" {
+			seriesName = append(seriesName, v.SeriesName)
+		}
 	}
 
 	var condition string
 	//var pars []interface{}
-	condition = " AND field_name  IN  ('" + strings.Join(matchTypeName, "','") + "')"
+	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, "','") + "')   )"
+	}
 
 	list, total, err = models.GetReportAndproductIndustrylListimgZhouqi(condition, startSize, pageSize)
 	if err != nil {

+ 3 - 0
models/zhouqi_article_map.go

@@ -7,6 +7,7 @@ import (
 type CygxZhouqiArticleMap struct {
 	CategoryId        int    `description:"产业Id"`
 	MatchTypeName     string `description:"行业名称"`
+	SeriesName        string `description:"系列名称"`
 	ArticleUpdateTime string `description:"对应文章的更新时间"`
 }
 
@@ -16,6 +17,7 @@ func GetCygxZhouqiArticleMapFirst() (items []*CygxZhouqiArticleMap, err error) {
 	sql := `SELECT
 			category_id,
 			match_type_name,
+			series_name,
 			article_update_time 
 		FROM
 			cygx_zhouqi_article_map 
@@ -34,6 +36,7 @@ func GetCygxZhouqiArticleMapByParentId(parentId int) (items []*CygxZhouqiArticle
 	sql := `SELECT
 			category_id,
 			match_type_name,
+			series_name,
 			article_update_time 
 		FROM
 			cygx_zhouqi_article_map