组合名字函数修改

This commit is contained in:
苏尹岚
2019-12-18 10:06:14 +08:00
parent 404a7b9040
commit 8cd09089a8
19 changed files with 54 additions and 71 deletions

View File

@@ -327,9 +327,14 @@ func FloatWeight2Int(weight float32) int {
return int(math.Round(float64(weight * 1000)))
}
func ComposeSkuName(prefix, name, comment, unit string, spec_quality float32, spec_unit string, maxLen int) (skuName string) {
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 != utils.ZeroTimeValue && exPrefixEnd != utils.ZeroTimeValue {
if time.Now().Before(exPrefixEnd) && time.Now().After(exPrefixBegin) {
skuName = exPrefix
}
}
if prefix != "" {
skuName = "[" + prefix + "]"
skuName += "[" + prefix + "]"
}
skuName += name
if unit == "份" {