1
This commit is contained in:
@@ -27,6 +27,37 @@ func GetThingMapList(db *DaoDB, thingType int, vendorIDs, thingIDs []int, vendor
|
||||
return cats, err
|
||||
}
|
||||
|
||||
func CreateThingMap(thingId int64, vendorThingID, appOrgCode, skuAttrId string) error {
|
||||
thingMap := &model.ThingMap{
|
||||
ThingID: thingId,
|
||||
ThingType: model.ThingTypeSku,
|
||||
VendorID: model.VendorIDDD,
|
||||
VendorOrgCode: appOrgCode,
|
||||
VendorThingID: vendorThingID,
|
||||
Remark: skuAttrId,
|
||||
SyncStatus: 0,
|
||||
}
|
||||
|
||||
WrapAddIDCULDEntity(thingMap, "jxadmin")
|
||||
return CreateEntity(GetDB(), thingMap)
|
||||
}
|
||||
|
||||
// GetThingToTiktokMapList 抖店获取同步类型
|
||||
func GetThingToTiktokMapList(db *DaoDB, vendorId int, thingId int64) (cats []*model.ThingMap, err error) {
|
||||
sql := `
|
||||
SELECT t1.*
|
||||
FROM thing_map t1
|
||||
WHERE thing_id = ? AND vendor_id = ? t1.deleted_at = ?
|
||||
`
|
||||
sqlParams := []interface{}{
|
||||
vendorId, thingId,
|
||||
utils.DefaultTimeValue,
|
||||
}
|
||||
|
||||
err = GetRows(db, &cats, sql, sqlParams...)
|
||||
return cats, err
|
||||
}
|
||||
|
||||
func GetThingMapMap(db *DaoDB, thingType int, vendorIDs, thingIDs []int) (thingMapMap map[int64][]*model.ThingMap, err error) {
|
||||
thingMapList, err := GetThingMapList(db, thingType, vendorIDs, thingIDs, nil)
|
||||
if err == nil {
|
||||
|
||||
Reference in New Issue
Block a user