增加商品额外前缀
This commit is contained in:
@@ -3,6 +3,7 @@ package mtwm
|
||||
import (
|
||||
"regexp"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"git.rosy.net.cn/baseapi/platformapi/mtwmapi"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
@@ -245,7 +246,17 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI
|
||||
},
|
||||
}
|
||||
foodData["skus"] = skus
|
||||
foodData["name"] = utils.LimitUTF8StringLen(utils.FilterEmoji(storeSku.SkuName), mtwmapi.MaxSkuNameCharCount)
|
||||
skuName := ""
|
||||
if storeSku.ExPrefixEnd != utils.ZeroTimeValue && storeSku.ExPrefixBegin != utils.ZeroTimeValue {
|
||||
if time.Now().Before(storeSku.ExPrefixEnd) && time.Now().After(storeSku.ExPrefixBegin) {
|
||||
skuName = storeSku.ExPrefix + utils.LimitUTF8StringLen(utils.FilterEmoji(storeSku.SkuName), mtwmapi.MaxSkuNameCharCount)
|
||||
} else {
|
||||
skuName = utils.LimitUTF8StringLen(utils.FilterEmoji(storeSku.SkuName), mtwmapi.MaxSkuNameCharCount)
|
||||
}
|
||||
} else {
|
||||
skuName = utils.LimitUTF8StringLen(utils.FilterEmoji(storeSku.SkuName), mtwmapi.MaxSkuNameCharCount)
|
||||
}
|
||||
foodData["name"] = skuName
|
||||
foodData["description"] = storeSku.Comment
|
||||
if isNeedUpdatePrice {
|
||||
foodData["price"] = jxutils.IntPrice2Standard(storeSku.VendorPrice)
|
||||
|
||||
Reference in New Issue
Block a user