diff --git a/business/model/dao/thing_map.go b/business/model/dao/thing_map.go index 907014b85..5eba0483d 100644 --- a/business/model/dao/thing_map.go +++ b/business/model/dao/thing_map.go @@ -1,7 +1,6 @@ package dao import ( - "fmt" "git.rosy.net.cn/baseapi/utils" "git.rosy.net.cn/jx-callback/business/model" ) @@ -51,15 +50,9 @@ func UpdateThingMap(thingMap *model.ThingMap) error { return err } -var thingMapList = make(map[string][]*model.ThingMap, 1024) - // GetThingToTiktokMapList 抖店获取同步类型 func GetThingToTiktokMapList(db *DaoDB, vendorId int, thingId int64, vendorOrgCode string) (cats []*model.ThingMap, err error) { - if _, ok := thingMapList[fmt.Sprintf("%d_%s_%d", vendorId, vendorOrgCode, thingId)]; ok { - if len(thingMapList[fmt.Sprintf("%d_%s_%d", vendorId, vendorOrgCode, thingId)]) != 0 { - return thingMapList[fmt.Sprintf("%d_%s_%d", vendorId, vendorOrgCode, thingId)], nil - } - } + sql := ` SELECT t1.* FROM thing_map t1 @@ -73,9 +66,7 @@ func GetThingToTiktokMapList(db *DaoDB, vendorId int, thingId int64, vendorOrgCo } err = GetRows(db, &cats, sql, sqlParams...) - if len(cats) != 0 { - thingMapList[fmt.Sprintf("%d_%s_%d", cats[0].VendorID, cats[0].VendorOrgCode, cats[0].ThingID)] = cats - } + return cats, err }