刷新结算价newearningprice也要刷
This commit is contained in:
@@ -784,7 +784,20 @@ func (c *OrderManager) RefreshHistoryOrdersEarningPrice(ctx *jxcontext.Context,
|
||||
}
|
||||
}
|
||||
jxutils.RefreshOrderSkuRelated(order)
|
||||
num, err := dao.UpdateEntity(db, order, "EarningPrice")
|
||||
storeID := 0
|
||||
if order.StoreID == 0 {
|
||||
storeID = order.JxStoreID
|
||||
} else {
|
||||
storeID = order.StoreID
|
||||
}
|
||||
store, _ := dao.GetStoreDetail(db, storeID, order.VendorID)
|
||||
payPercentage := store.PayPercentage
|
||||
if payPercentage <= 50 {
|
||||
order.NewEarningPrice = order.TotalShopMoney * int64((100 - payPercentage/2)) / 100
|
||||
} else {
|
||||
order.NewEarningPrice = order.EarningPrice
|
||||
}
|
||||
num, err := dao.UpdateEntity(db, order, "EarningPrice", "NewEarningPrice")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user