12345678910111213141516171819202122232425262728293031 |
- package models
- import (
- "github.com/beego/beego/v2/client/orm"
- "time"
- )
- // 谷歌出行指数
- type BaseFromChangesVisitorsCovid struct {
- Id uint64 `orm:"column(id);pk"` //序号
- Entity string `orm:"column(entity)"` //国家
- Code string `orm:"column(code)"` //国家编码
- EdbCode string `orm:"column(edb_code)"` //指标ID
- Day time.Time `orm:"column(day)"` //统计的日期
- RetailAndRecreation string `orm:"column(retail_and_recreation)"`
- GroceryAndPharmacy string `orm:"column(grocery_and_pharmacy)"`
- Residential string `orm:"column(residential)"`
- TransitStations string `orm:"column(transit_stations)"`
- Parks string `orm:"column(parks)"`
- Workplaces string `orm:"column(workplaces)"`
- Total string `orm:"column(total)"`
- CreateTime time.Time `orm:"auto_now_add;column(create_time)"` //创建时间
- ModifyTime time.Time `orm:"auto_now_add;column(modify_time)"` //修改时间
- }
- func GetChangesVisitorsCovid(startDate, endDate string) (list []*BaseFromChangesVisitorsCovid, err error) {
- o := orm.NewOrm()
- sql := `SELECT * FROM base_from_changes_visitors_covid WHERE create_time>=? AND create_time<=? `
- _, err = o.Raw(sql, startDate, endDate).QueryRows(&list)
- return
- }
|