package models import ( "github.com/beego/beego/v2/client/orm" "time" ) type BaseFromTradeShanghaiIndex struct { BaseFromTradeShangHaiIndexId int `orm:"column(base_from_trade_shanghai_index_id);pk"` Rank int DealShortName string DealName string DealCode string DealValue int DealChange int BuyShortName string BuyName string BuyCode string BuyValue int BuyChange int SoldShortName string SoldName string SoldCode string SoldValue int SoldChange int Frequency string ClassifyName string ClassifyType string CreateTime time.Time ModifyTime time.Time DataTime string } func GetTradeShanghaiIndex(startDate, endDate string) (list []*BaseFromTradeShanghaiIndex, err error) { o := orm.NewOrm() sql := `SELECT * FROM base_from_trade_shanghai_index WHERE create_time>=? AND create_time<=? ` _, err = o.Raw(sql, startDate, endDate).QueryRows(&list) return }