|
@@ -16,6 +16,9 @@ type BaseFromUsdaFasIndex struct {
|
|
Frequency string
|
|
Frequency string
|
|
Unit string
|
|
Unit string
|
|
Sort int
|
|
Sort int
|
|
|
|
+ StartDate string `description:"开始日期"`
|
|
|
|
+ EndDate string `description:"结束日期"`
|
|
|
|
+ EndValue float64
|
|
CreateTime time.Time
|
|
CreateTime time.Time
|
|
ModifyTime time.Time
|
|
ModifyTime time.Time
|
|
}
|
|
}
|
|
@@ -127,7 +130,7 @@ func GetUsdaFasIndexDataTimePageByCodes(indexCodes []string, startSize, pageSize
|
|
|
|
|
|
func GetUsdaFasIndexDataTimePageCount(indexCodes []string) (count int, err error) {
|
|
func GetUsdaFasIndexDataTimePageCount(indexCodes []string) (count int, err error) {
|
|
o := orm.NewOrmUsingDB("data")
|
|
o := orm.NewOrmUsingDB("data")
|
|
- sql := ` SELECT COUNT(1) AS count FROM base_from_usda_fas_data WHERE index_code in (` + utils.GetOrmInReplace(len(indexCodes)) + `) GROUP BY data_time `
|
|
|
|
|
|
+ sql := ` SELECT COUNT(DISTINCT data_time) AS count FROM base_from_usda_fas_data WHERE index_code in (` + utils.GetOrmInReplace(len(indexCodes)) + `) `
|
|
err = o.Raw(sql, indexCodes).QueryRow(&count)
|
|
err = o.Raw(sql, indexCodes).QueryRow(&count)
|
|
return
|
|
return
|
|
}
|
|
}
|