京西折扣
This commit is contained in:
@@ -1532,7 +1532,7 @@ func ChangeJxPriceByDiscountAct(ctx *jxcontext.Context) {
|
|||||||
storeSku = storeSkus[0]
|
storeSku = storeSkus[0]
|
||||||
shouldStockOut = utils.Float64TwoInt64(math.Ceil(float64(storeSku.Stock) / float64(60))) //每个时间点应出货 = 总库存/60 = N
|
shouldStockOut = utils.Float64TwoInt64(math.Ceil(float64(storeSku.Stock) / float64(60))) //每个时间点应出货 = 总库存/60 = N
|
||||||
actualStockOut int64 //每个时间点实际出货 = C
|
actualStockOut int64 //每个时间点实际出货 = C
|
||||||
pricePercentage = 0.02 //每次涨跌值为 原价的 2%,即原价100,每个时间点降价为2,涨价也为2
|
pricePercentage float64 //每次涨跌值为 原价的 2%,即原价100,每个时间点降价为2,涨价也为2
|
||||||
actualPricePercentage float64
|
actualPricePercentage float64
|
||||||
minJxPrice int64
|
minJxPrice int64
|
||||||
)
|
)
|
||||||
@@ -1551,6 +1551,7 @@ func ChangeJxPriceByDiscountAct(ctx *jxcontext.Context) {
|
|||||||
}()
|
}()
|
||||||
//第一档时间内
|
//第一档时间内
|
||||||
if (time.Now().Hour() >= 10 && time.Now().Hour() < 20) || (time.Now().Hour() == 20 && time.Now().Minute() < 1) {
|
if (time.Now().Hour() >= 10 && time.Now().Hour() < 20) || (time.Now().Hour() == 20 && time.Now().Minute() < 1) {
|
||||||
|
pricePercentage = 0.02
|
||||||
if actStoreSku.TrendType == model.TrendTypeUp {
|
if actStoreSku.TrendType == model.TrendTypeUp {
|
||||||
actualPricePercentage = float64(actStoreSku.OriginalPrice) * (float64(1) + pricePercentage)
|
actualPricePercentage = float64(actStoreSku.OriginalPrice) * (float64(1) + pricePercentage)
|
||||||
} else if actStoreSku.TrendType == model.TrendTypeDown {
|
} else if actStoreSku.TrendType == model.TrendTypeDown {
|
||||||
@@ -1585,7 +1586,7 @@ func ChangeJxPriceByDiscountAct(ctx *jxcontext.Context) {
|
|||||||
dao.Rollback(db)
|
dao.Rollback(db)
|
||||||
}
|
}
|
||||||
} else { //第二档时间内
|
} else { //第二档时间内
|
||||||
|
pricePercentage = 0.1
|
||||||
}
|
}
|
||||||
dao.Commit(db)
|
dao.Commit(db)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user