|
@@ -8,8 +8,8 @@ type EdbInfo struct {
|
|
|
UserId int
|
|
|
SecName string `orm:"column(SEC_NAME);" description:"指标名称"`
|
|
|
NoticeTime string
|
|
|
- Frequency string
|
|
|
- TradeCode string `orm:"column(TRADE_CODE);" description:"指标编码"`
|
|
|
+ Frequency string
|
|
|
+ TradeCode string `orm:"column(TRADE_CODE);" description:"指标编码"`
|
|
|
}
|
|
|
|
|
|
//获取日度指标
|
|
@@ -22,10 +22,18 @@ func GetEdbInfoByFrequency(frequency string) (items []*EdbInfo, err error) {
|
|
|
}
|
|
|
|
|
|
//获取日度指标
|
|
|
-func GetEdbInfoByFrequencyWeek(frequency,weekDay string) (items []*EdbInfo, err error) {
|
|
|
- sql := `SELECT * FROM edbinfo WHERE frequency=? AND notice_time<>'' and left(notice_time,2)=? `
|
|
|
+func GetEdbInfoByFrequencyWeek(frequency, weekDay string) (items []*EdbInfo, err error) {
|
|
|
+ sql := `SELECT * FROM edbinfo WHERE frequency=? AND notice_time<>'' AND left(notice_time,2)=? `
|
|
|
o := orm.NewOrm()
|
|
|
o.Using("edb")
|
|
|
- _, err = o.Raw(sql, frequency,weekDay).QueryRows(&items)
|
|
|
+ _, err = o.Raw(sql, frequency, weekDay).QueryRows(&items)
|
|
|
+ return
|
|
|
+}
|
|
|
+
|
|
|
+func GetEdbdataCount(tradeCode, nowDate string) (count int, err error) {
|
|
|
+ sql := `SELECT COUNT(1) AS count FROM edbdata WHERE TRADE_CODE=? AND DT=? `
|
|
|
+ o := orm.NewOrm()
|
|
|
+ o.Using("edb")
|
|
|
+ err = o.Raw(sql, tradeCode, nowDate).QueryRow(&count)
|
|
|
return
|
|
|
}
|