This commit is contained in:
邹宗楠
2022-12-20 18:01:11 +08:00
parent fd61639e7f
commit 72981c504e
2 changed files with 8 additions and 12 deletions

View File

@@ -154,11 +154,7 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI
PickupMethod: "0",
OuterProductId: utils.Int2Str(storeSku.SkuID), // 本地skuId为外部商品id
}
if len(param.Name) < 23 { // 中文字符一个汉字三个长度符号/数字/字母两个长度,商品名称不能大于
param.Name += "【同城配送】"
} else if len(param.Name) > 90 { // 抖音最大60个字符,三十个汉字
param.Name = checkNameLenght(param.Name)
}
param.Name = checkNameLenght(param.Name)
// 获取上传图,商品轮播图
img, detailImg, err := GetTiktokImgList(api, utils.Int2Str(storeSku.StoreID), storeDetail.VendorOrgCode, storeSku.DescImg, storeSku.ImgOrigin, storeSku.Img2, storeSku.Img3, storeSku.Img4, storeSku.Img5)
@@ -364,12 +360,7 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI
} else {
param.CategoryLeafId = storeSku.VendorVendorCatID
}
if len(param.Name) < 23 { // 中文字符一个汉字三个长度符号/数字/字母两个长度,商品名称不能大于
param.Name += "【同城配送】"
} else if len(param.Name) > 90 { // 抖音最大60个字符,三十个汉字
param.Name = checkNameLenght(param.Name)
}
param.Name = checkNameLenght(param.Name)
// 获取上传图,商品轮播图
img, detailImg, err := GetTiktokImgList(api, utils.Int2Str(storeSku.StoreID), storeDetail.VendorOrgCode, storeSku.DescImg, storeSku.ImgOrigin, storeSku.Img2, storeSku.Img3, storeSku.Img4, storeSku.Img5)
@@ -454,6 +445,9 @@ func checkNameLenght(name string) string {
} else {
return name[0 : len(name)-(maxLen-60)*3]
}
} else if maxLen < 16 {
name += "【同城配送】"
return name
}
return name
}