商品关键字
This commit is contained in:
@@ -328,32 +328,6 @@ func FloatWeight2Int(weight float32) int {
|
||||
}
|
||||
|
||||
func ComposeSkuName(prefix, name, comment, unit string, spec_quality float32, spec_unit string, maxLen int, exPrefix string, exPrefixBegin, exPrefixEnd *time.Time) (skuName string) {
|
||||
if exPrefix != "" && exPrefixBegin != nil && exPrefixEnd != nil {
|
||||
if time.Now().After(*exPrefixBegin) && time.Now().Before(*exPrefixEnd) {
|
||||
skuName = exPrefix
|
||||
}
|
||||
}
|
||||
if prefix != "" {
|
||||
skuName += "[" + prefix + "]"
|
||||
}
|
||||
skuName += name
|
||||
if unit == "份" {
|
||||
skuName += "约"
|
||||
}
|
||||
if unit != "" {
|
||||
skuName += ComposeSkuSpec(spec_quality, spec_unit)
|
||||
skuName += "/" + unit
|
||||
}
|
||||
if comment != "" {
|
||||
skuName += "(" + comment + ")"
|
||||
}
|
||||
if maxLen > 0 {
|
||||
skuName = utils.LimitUTF8StringLen(skuName, maxLen)
|
||||
}
|
||||
return skuName
|
||||
}
|
||||
|
||||
func ComposeSkuNameSync(prefix, name, comment, unit string, spec_quality float32, spec_unit string, maxLen int, exPrefix string, exPrefixBegin, exPrefixEnd *time.Time) (skuName string) {
|
||||
if exPrefix != "" && exPrefixBegin != nil && exPrefixEnd != nil {
|
||||
if utils.Time2Date(time.Now().Add(6*time.Hour)).Sub(*exPrefixBegin) >= 0 && utils.Time2Date(time.Now()).Sub(*exPrefixEnd) < 0 {
|
||||
skuName = exPrefix
|
||||
|
||||
Reference in New Issue
Block a user