Accept Merge Request #139: (yonghui -> mark)

Merge Request: 中位价计算方式修改,乘除替换
Created By: @苏尹岚
Accepted By: @苏尹岚
URL: https://rosydev.coding.net/p/jx-callback/d/jx-callback/git/merge/139
This commit is contained in:
苏尹岚
2020-01-13 16:46:39 +08:00
3 changed files with 9 additions and 6 deletions

View File

@@ -2392,10 +2392,10 @@ func RefershStoreSkusMidPrice(ctx *jxcontext.Context, storeIDs []int) (err error
return err
}
if len(priceReferList) > 0 {
if storeSku.UnitPrice > priceReferList[0].MidUnitPrice*payPercentage/100 {
if storeSku.UnitPrice > priceReferList[0].MidUnitPrice/payPercentage*100 {
skuBindInfo := &StoreSkuBindInfo{
NameID: priceReferList[0].NameID,
UnitPrice: priceReferList[0].MidUnitPrice * payPercentage / 100,
UnitPrice: priceReferList[0].MidUnitPrice / payPercentage * 100,
}
skuBindInfos = append(skuBindInfos, skuBindInfo)
}
@@ -3013,7 +3013,7 @@ func FocusStoreSkusBySku(ctx *jxcontext.Context, skuBindInfos []*StoreSkuBindInf
}
priceReferList, _ := dao.GetPriceReferSnapshotNoPage(db, []int{store.CityCode}, nil, []int{skuList[0].NameID}, utils.Time2Date(time.Now().AddDate(0, 0, -1)))
if len(priceReferList) > 0 {
price = priceReferList[0].MidUnitPrice * payPercentage / 100
price = priceReferList[0].MidUnitPrice / payPercentage * 100
}
}
skuBindSkuInfo := &StoreSkuBindSkuInfo{
@@ -3121,7 +3121,7 @@ func AutoFocusStoreSkusForTopSkus(ctx *jxcontext.Context, isAsync, isContinueWhe
}
priceReferList, err := dao.GetPriceReferSnapshotNoPage(db, []int{vv.CityCode}, nil, []int{vv.ID}, utils.Time2Date(time.Now().AddDate(0, 0, -1)))
if err == nil && len(priceReferList) > 0 {
storeSkuBindInfo.UnitPrice = priceReferList[0].MidUnitPrice * payPercentage / 100
storeSkuBindInfo.UnitPrice = priceReferList[0].MidUnitPrice / payPercentage * 100
}
skuBindInfoList = append(skuBindInfoList, storeSkuBindInfo)
}