- auto create jd promotion on jd new promotion event
This commit is contained in:
@@ -115,6 +115,16 @@ func IntMap2List(intMap map[int]int) []int {
|
||||
return retVal
|
||||
}
|
||||
|
||||
func Int64Map2List(int64Map map[int64]int) []int64 {
|
||||
retVal := make([]int64, len(int64Map))
|
||||
index := 0
|
||||
for k := range int64Map {
|
||||
retVal[index] = k
|
||||
index++
|
||||
}
|
||||
return retVal
|
||||
}
|
||||
|
||||
// 计算SKU价格,unitPrice为一斤的单价,specQuality为质量,单位为克
|
||||
func CaculateSkuPrice(unitPrice int, specQuality float32, specUnit string, skuNameUnit string) int {
|
||||
if skuNameUnit != "份" {
|
||||
@@ -170,3 +180,10 @@ func FormalizePageSize(pageSize int) int {
|
||||
func FormalizeName(name string) string {
|
||||
return utils.TrimBlankChar(strings.Replace(strings.Replace(name, "\t", "", -1), "\"", "", -1))
|
||||
}
|
||||
|
||||
func Int2OneZero(value int) int {
|
||||
if value != 0 {
|
||||
return 1
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user