|
@@ -81,8 +81,6 @@ func (this *ClarksonsDataController) ClarksonsData() {
|
|
|
}
|
|
|
|
|
|
index.IndexCode = indexCode
|
|
|
- index.Frequency = "周度"
|
|
|
- index.ClassifyId = 0
|
|
|
index.CreateTime = time.Now()
|
|
|
index.ModifyTime = time.Now()
|
|
|
|
|
@@ -141,7 +139,7 @@ func (this *ClarksonsDataController) ClarksonsData() {
|
|
|
if len(itemsIndex) > 2 {
|
|
|
time1, _ := time.Parse(utils.FormatDate, itemsIndex[0].DataTime)
|
|
|
time2, _ := time.Parse(utils.FormatDate, itemsIndex[1].DataTime)
|
|
|
- diff := time2.Sub(time1)/24
|
|
|
+ diff := time2.Sub(time1).Hours() / 24
|
|
|
|
|
|
if diff < 5 {
|
|
|
index.Frequency = "日度"
|
|
@@ -160,11 +158,10 @@ func (this *ClarksonsDataController) ClarksonsData() {
|
|
|
fmt.Println("修改指标频度错误", err)
|
|
|
return
|
|
|
} else {
|
|
|
- fmt.Println("修改指标频度成功 ", index.IndexCode,index.Frequency)
|
|
|
+ fmt.Println("修改指标频度成功 ", index.IndexCode, index.Frequency)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
count, err := models.AddBaseFromClarksonsDataMuti(itemsIndex)
|
|
|
if err != nil {
|
|
|
fmt.Println("添加数据错误", err.Error())
|