Explorar o código

修改数据刷新逻辑

tuoling805 %!s(int64=2) %!d(string=hai) anos
pai
achega
6bad7b762b

+ 2 - 2
models/data_manage/base_from_changes_visitors_covid.go

@@ -24,9 +24,9 @@ type BaseFromChangesVisitorsCovid struct {
 }
 
 // AddBaseFromChangesVisitorsCovidMulti 批量添加谷歌出行记录
-func AddBaseFromChangesVisitorsCovidMulti(list *BaseFromChangesVisitorsCovid) (err error) {
+func AddBaseFromChangesVisitorsCovid(item *BaseFromChangesVisitorsCovid) (err error) {
 	o := orm.NewOrm()
-	_, err = o.InsertMulti(1, list)
+	_, err = o.Insert(item)
 	return
 }
 

+ 1 - 1
services/changes_visitors_covid.go

@@ -46,7 +46,7 @@ func SyncChangesVisitorsCovid() (err error) {
 
 	for _, zv := range respObj.Data {
 		if _, ok := existIndexMap[zv.Id]; !ok {
-			err := data_manage.AddBaseFromChangesVisitorsCovidMulti(zv)
+			err := data_manage.AddBaseFromChangesVisitorsCovid(zv)
 			if err != nil {
 				fmt.Println("insert error:", err)
 			}