|
@@ -90,6 +90,9 @@ func AddSourceChangesVisitorsCovid() (err error) {
|
|
|
if len(row) >= 9{
|
|
|
tmp := new(models.BaseFromChangesVisitorsCovid)
|
|
|
tmp.Entity = row[0]
|
|
|
+ if !filterCountry(tmp.Entity) { //只需要五个国家的数据
|
|
|
+ continue
|
|
|
+ }
|
|
|
tmp.Code = row[1]
|
|
|
tmp.EdbCode = tmp.Code + "-TravelIndex"
|
|
|
day, tErr := time.Parse(utils.FormatDate, row[2])
|
|
@@ -237,3 +240,20 @@ func GetSourceChangesVisitorsCovid() (filePathStr string, err error) {
|
|
|
log.Printf("wrote %s", filePathStr)
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
+func filterCountry(entity string) bool {
|
|
|
+ switch entity {
|
|
|
+ case "United States":
|
|
|
+ return true
|
|
|
+ case "United Kingdom":
|
|
|
+ return true
|
|
|
+ case "France":
|
|
|
+ return true
|
|
|
+ case "Spain":
|
|
|
+ return true
|
|
|
+ case "Italy":
|
|
|
+ return true
|
|
|
+ default:
|
|
|
+ return false
|
|
|
+ }
|
|
|
+}
|