package models import ( "github.com/beego/beego/v2/client/orm" "time" ) type EdbDataPb struct { EdbDataId int `orm:"column(edb_data_id);pk"` EdbInfoId int EdbCode string DataTime string Value float64 Status int CreateTime time.Time ModifyTime time.Time Ticker string Field string DataTimestamp int64 } func GetEdbDataPb(indexCode, startDate, endDate string) (list []*EdbDataPb, err error) { o := orm.NewOrm() sql := `SELECT * FROM edb_data_pb WHERE edb_code=? AND create_time>=? AND create_time<=? ` _, err = o.Raw(sql, indexCode, startDate, endDate).QueryRows(&list) return }