平台价保留到毛,活动价不变
This commit is contained in:
@@ -253,7 +253,7 @@ func ActStoreSkuParam2Model(ctx *jxcontext.Context, db *dao.DaoDB, act *model.Ac
|
|||||||
if v.PricePercentage != 0 {
|
if v.PricePercentage != 0 {
|
||||||
percentage = v.PricePercentage
|
percentage = v.PricePercentage
|
||||||
}
|
}
|
||||||
actSkuMap.ActualActPrice = int64(jxutils.CaculateSkuVendorPrice(int(actSkuMap.VendorPrice), percentage, 0))
|
actSkuMap.ActualActPrice = int64(jxutils.CaculateSkuActVendorPrice(int(actSkuMap.VendorPrice), percentage, 0))
|
||||||
if actSkuMap.ActualActPrice > 10 {
|
if actSkuMap.ActualActPrice > 10 {
|
||||||
actSkuMap.ActualActPrice = int64(math.Floor(float64(actSkuMap.ActualActPrice)/10) * 10)
|
actSkuMap.ActualActPrice = int64(math.Floor(float64(actSkuMap.ActualActPrice)/10) * 10)
|
||||||
}
|
}
|
||||||
@@ -596,7 +596,7 @@ func CreateAct(ctx *jxcontext.Context, act *model.Act, vendorIDs []int, vendorOr
|
|||||||
_, err = SyncAct(ctx, task, actID, nil, false)
|
_, err = SyncAct(ctx, task, actID, nil, false)
|
||||||
return retVal, err
|
return retVal, err
|
||||||
}, neeSyncActIDs)
|
}, neeSyncActIDs)
|
||||||
|
|
||||||
tasksch.HandleTask(task, nil, true).Run()
|
tasksch.HandleTask(task, nil, true).Run()
|
||||||
if !isAsync {
|
if !isAsync {
|
||||||
hint = utils.Int2Str(act.ID)
|
hint = utils.Int2Str(act.ID)
|
||||||
|
|||||||
@@ -259,9 +259,19 @@ func ConstrainPricePercentage(percentage int) int {
|
|||||||
return percentage
|
return percentage
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func CaculateSkuActVendorPrice(price, percentage, priceAdd int) (vendorPrice int) {
|
||||||
|
percentage = ConstrainPricePercentage(percentage)
|
||||||
|
vendorPrice = int(math.Round(float64(price*percentage)/100)) + priceAdd
|
||||||
|
if vendorPrice < 1 {
|
||||||
|
vendorPrice = 1
|
||||||
|
}
|
||||||
|
return vendorPrice
|
||||||
|
}
|
||||||
|
|
||||||
func CaculateSkuVendorPrice(price, percentage, priceAdd int) (vendorPrice int) {
|
func CaculateSkuVendorPrice(price, percentage, priceAdd int) (vendorPrice int) {
|
||||||
percentage = ConstrainPricePercentage(percentage)
|
percentage = ConstrainPricePercentage(percentage)
|
||||||
vendorPrice = int(math.Round(float64(price*percentage)/100)) + priceAdd
|
vendorPrice = int(math.Round(float64(price*percentage)/100)) + priceAdd
|
||||||
|
vendorPrice = int(math.Ceil(float64(vendorPrice)/10) * 10)
|
||||||
if vendorPrice < 1 {
|
if vendorPrice < 1 {
|
||||||
vendorPrice = 1
|
vendorPrice = 1
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user