|
@@ -729,7 +729,7 @@ func UpdateArticleResourceData(sourceId int) {
|
|
|
item.Source = source
|
|
|
item.PublishDate = publishDate
|
|
|
item.CreateTime = time.Now()
|
|
|
- item.SearchTitle = detail.Title
|
|
|
+ item.SearchTitle = detail.Title + "{|}" + detail.FieldName + "{|}" + detail.Stock + "{|}" + industrialName + "{|}" + subjectName
|
|
|
if detail.SeriesName == "行业深度" || detail.SeriesName == "季度策略" {
|
|
|
item.Sort = 100 // 这两个类型优先展示
|
|
|
}
|
|
@@ -1122,3 +1122,60 @@ func UpdateFICCReportResourceData(sourceId int, listFiccSet *ficc_report.GetRepo
|
|
|
}
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
+//func init() {
|
|
|
+// initcygx15_0()
|
|
|
+//}
|
|
|
+
|
|
|
+func initcygx15_0() {
|
|
|
+ var condition string
|
|
|
+ var pars []interface{}
|
|
|
+ condition = ` AND source_id >= 7000 AND source = 'article' `
|
|
|
+ //全部都是标题搜索
|
|
|
+ list, e := models.GetResourceDataListCondition(condition, pars, 0, 10000)
|
|
|
+ if e != nil && e.Error() != utils.ErrNoRow() {
|
|
|
+ fmt.Println(e)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ fmt.Println(len(list))
|
|
|
+
|
|
|
+ //return
|
|
|
+
|
|
|
+ for k, v := range list {
|
|
|
+ sourceId := v.SourceId
|
|
|
+ fmt.Println(k, "+++", v.SourceId, "___", v.SearchTitle)
|
|
|
+ var industrialName string
|
|
|
+ var subjectName string
|
|
|
+ //建立首页资源表,与产业的关系
|
|
|
+ industrialList, e := models.GetIndustrialArticleGroupManagementListByArticleId(sourceId)
|
|
|
+ if e != nil && e.Error() != utils.ErrNoRow() {
|
|
|
+ fmt.Println("GetIndustrialArticleGroupManagementListByArticleId", e)
|
|
|
+ }
|
|
|
+
|
|
|
+ for _, v := range industrialList {
|
|
|
+ industrialName += v.IndustryName
|
|
|
+ }
|
|
|
+
|
|
|
+ //建立首页资源表,与标的 的关系
|
|
|
+ subjectList, e := models.GetSubjectArticleGroupManagementListByArtcileId(sourceId)
|
|
|
+ if e != nil && e.Error() != utils.ErrNoRow() {
|
|
|
+ fmt.Println("GetSubjectArticleGroupManagementListByArtcileId", e)
|
|
|
+ }
|
|
|
+
|
|
|
+ for _, vs := range subjectList {
|
|
|
+ subjectName += vs.SubjectName
|
|
|
+ }
|
|
|
+ detail, e := models.GetArticleDetailById(sourceId)
|
|
|
+ if e != nil {
|
|
|
+ fmt.Println("GetArticleDetailById", e)
|
|
|
+ continue
|
|
|
+ }
|
|
|
+ searchTitle := detail.Title + "{|}" + detail.FieldName + "{|}" + detail.Stock + "{|}" + industrialName + "{|}" + subjectName
|
|
|
+ //fmt.Println(searchTitle)
|
|
|
+ e = models.UpdatecygxResourceDatasearchTitle(searchTitle, sourceId)
|
|
|
+ if e != nil {
|
|
|
+ fmt.Println("UpdatecygxResourceDatasearchTitle", e)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return
|
|
|
+}
|