1
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
package dao
|
package dao
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"git.rosy.net.cn/baseapi/utils"
|
"git.rosy.net.cn/baseapi/utils"
|
||||||
"git.rosy.net.cn/jx-callback/business/model"
|
"git.rosy.net.cn/jx-callback/business/model"
|
||||||
)
|
)
|
||||||
@@ -51,15 +50,9 @@ func UpdateThingMap(thingMap *model.ThingMap) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
var thingMapList = make(map[string][]*model.ThingMap, 1024)
|
|
||||||
|
|
||||||
// GetThingToTiktokMapList 抖店获取同步类型
|
// GetThingToTiktokMapList 抖店获取同步类型
|
||||||
func GetThingToTiktokMapList(db *DaoDB, vendorId int, thingId int64, vendorOrgCode string) (cats []*model.ThingMap, err error) {
|
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 := `
|
sql := `
|
||||||
SELECT t1.*
|
SELECT t1.*
|
||||||
FROM thing_map t1
|
FROM thing_map t1
|
||||||
@@ -73,9 +66,7 @@ func GetThingToTiktokMapList(db *DaoDB, vendorId int, thingId int64, vendorOrgCo
|
|||||||
}
|
}
|
||||||
|
|
||||||
err = GetRows(db, &cats, sql, sqlParams...)
|
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
|
return cats, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user