func GetPoiDataList(poiId, sTime string) (list []GrassPoiReportDay, count int64, err error) {
one := &GrassPoiReportDay{}
o := orm.NewOrmUsingDB("grass_data")//这里选择的是其他的数据库
count, err = o.QueryTable(one.TableName()).Filter("poi_id", poiId).Filter("statistics_date__gte", sTime).OrderBy("-created_at").All(&list)
return
}
dbName2 := "grass_data"
connStr2 := fmt.Sprintf("%s:%s@tcp(%s:%s)/%s?charset=%s", dbUser, dbPwd, dbHost, dbPort, dbName2, dbCharset)
_ = orm.RegisterDataBase(dbName2, dbType, connStr2)
dbClient2, _ := orm.GetDB(dbName2)
dbClient2.SetConnMaxLifetime(time.Hour)
orm.SetMaxIdleConns(dbName2, 128)
orm.SetMaxOpenConns(dbName2, 128)
orm.Debug = true