美团外卖分类名,商品名,完全过滤掉emoji

This commit is contained in:
gazebo
2019-10-16 16:38:53 +08:00
parent 2e5e2be5bb
commit d8e843f59c
2 changed files with 6 additions and 6 deletions

View File

@@ -310,7 +310,7 @@ func jxCatSeq2Ebai(seq int) int {
}
func formatCatName(name string) string {
return name //utils.TrimBlankChar(utils.FilterMb4(name))
return name
}
func (p *PurchaseHandler) GetStoreSkusFullInfo(ctx *jxcontext.Context, parentTask tasksch.ITask, storeID int, vendorStoreID string, storeSkuList []*partner.StoreSkuInfo) (skuNameList []*partner.SkuNameInfo, err error) {

View File

@@ -110,7 +110,7 @@ func (p *PurchaseHandler) CreateStoreCategory(ctx *jxcontext.Context, storeID in
}
if level == 2 { // 二级分类
// 创建二级分类
originName = utils.FilterMb4(storeCat.ParentCatName)
originName = utils.FilterEmoji(storeCat.ParentCatName)
catName = storeCat.ParentCatName
catCode = storeCat.ParentID
subCatName = storeCat.Name
@@ -127,8 +127,8 @@ func (p *PurchaseHandler) CreateStoreCategory(ctx *jxcontext.Context, storeID in
if catName == "" {
panic("catName is empty")
}
catName = utils.FilterMb4(catName)
subCatName = utils.FilterMb4(subCatName)
catName = utils.FilterEmoji(catName)
subCatName = utils.FilterEmoji(subCatName)
globals.SugarLogger.Debugf("mtwm CreateStoreCategory vendorStoreID:%s, originName:%s, catCode:%d, catName:%s, subCatCode:%d, subCatName:%s, seq:%d",
vendorStoreID, originName, catCode, catName, subCatCode, subCatName, storeCat.Seq)
if !(originName == catName && subCatName == "") {
@@ -143,7 +143,7 @@ func (p *PurchaseHandler) CreateStoreCategory(ctx *jxcontext.Context, storeID in
}
}
if err == nil {
// storeCat.VendorCatID = utils.FilterMb4(storeCat.Name)
// storeCat.VendorCatID = utils.FilterEmoji(storeCat.Name)
storeCat.VendorCatID = utils.Int2Str(storeCat.ID)
}
return err
@@ -195,7 +195,7 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI
},
}
foodData["skus"] = skus
foodData["name"] = utils.LimitUTF8StringLen(storeSku.SkuName, mtwmapi.MaxSkuNameCharCount)
foodData["name"] = utils.LimitUTF8StringLen(utils.FilterEmoji(storeSku.SkuName), mtwmapi.MaxSkuNameCharCount)
foodData["description"] = storeSku.Comment
if isNeedUpdatePrice {
foodData["price"] = jxutils.IntPrice2Standard(storeSku.VendorPrice)