nenew_earning_perice

This commit is contained in:
苏尹岚
2020-08-04 11:59:10 +08:00
parent 8cd3a1f637
commit 7034a37b62

View File

@@ -194,6 +194,21 @@ func (c *OrderManager) OnOrderStatusChanged(vendorOrgCode string, orderStatus *m
}
}
}
//更新订单new_earning_price
if order.EarningType == model.EarningTypePoints {
waybill, _ := c.LoadWaybill(order.VendorWaybillID, order.WaybillVendorID)
store, _ := c.LoadStoreDetail(jxutils.GetSaleStoreIDFromOrder(order), order.VendorID)
if waybill == nil {
if order.NewEarningPrice == 0 || order.NewEarningPrice != order.TotalShopMoney*int64(100-store.PayPercentage)/int64(100) {
order.NewEarningPrice = order.TotalShopMoney * int64(100-store.PayPercentage) / int64(100)
}
} else {
if order.NewEarningPrice == 0 || order.NewEarningPrice != (order.TotalShopMoney-waybill.DesiredFee)*int64(100-store.PayPercentage)/int64(100) {
order.NewEarningPrice = (order.TotalShopMoney - waybill.DesiredFee) * int64(100-store.PayPercentage) / int64(100)
}
}
dao.UpdateEntity(db, order, "NewEarningPrice")
}
}
}
if !isDuplicated {