소스 검색

no message

xingzai 1 년 전
부모
커밋
e91c3f740e
2개의 변경된 파일21개의 추가작업 그리고 20개의 파일을 삭제
  1. 2 1
      services/chart.go
  2. 19 19
      services/resource_data.go

+ 2 - 1
services/chart.go

@@ -588,7 +588,8 @@ func GetChartDetailByApi(chartId int) (err error) {
 		}
 	}
 
-	go AddComprehensiveChart(chartId) //同步图表到综合页面的搜索
+	go AddComprehensiveChart(chartId)      //同步图表到综合页面的搜索
+	go UpdateNewchartResourceData(chartId) ////把数据写入 cygx_resource_data 表
 	return
 
 }

+ 19 - 19
services/resource_data.go

@@ -482,24 +482,24 @@ func UpdateResourceData(sourceId int, source, doType, publishDate string) (err e
 	return
 }
 
-func init130() {
-	//UpdateNewchartResourceData(5509)
-
-	var condition string
-	var pars []interface{}
-	condition += ` AND publish_status  = 1 `
-
-	list, e := models.GetChartList(condition, pars, 0, 1000000)
-	if e != nil {
-		fmt.Println(e)
-		return
-	}
-
-	for _, v := range list {
-		fmt.Println(v.ChartId)
-		UpdateNewchartResourceData(v.ChartId)
-	}
-}
+//func init130() {
+//	//UpdateNewchartResourceData(5509)
+//
+//	var condition string
+//	var pars []interface{}
+//	condition += ` AND publish_status  = 1 `
+//
+//	list, e := models.GetChartList(condition, pars, 0, 1000000)
+//	if e != nil {
+//		fmt.Println(e)
+//		return
+//	}
+//
+//	for _, v := range list {
+//		fmt.Println(v.ChartId)
+//		UpdateNewchartResourceData(v.ChartId)
+//	}
+//}
 
 // 更新图表
 func UpdateNewchartResourceData(sourceId int) {
@@ -538,7 +538,7 @@ func UpdateNewchartResourceData(sourceId int) {
 			err = errors.New("GetArticleDetailById, Err: " + e.Error())
 			return
 		}
-		publishDate := time.Now().Format(utils.FormatDateTime)
+		publishDate := detail.CreateDate
 		item := new(models.CygxResourceData)
 
 		item.SourceId = sourceId