- 修复饿百调整单消息没有正确更新订单信息的BUG
This commit is contained in:
@@ -421,3 +421,17 @@ func HandleUserWXRemark(db *dao.DaoDB, mobile string) (err error) {
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
func RefreshOrderSkuRelated(order *model.GoodsOrder) *model.GoodsOrder {
|
||||
order.SkuCount = 0
|
||||
order.GoodsCount = 0
|
||||
order.SalePrice = 0
|
||||
order.Weight = 0
|
||||
for _, sku := range order.Skus {
|
||||
order.SkuCount++
|
||||
order.GoodsCount += sku.Count
|
||||
order.SalePrice += sku.SalePrice * int64(sku.Count)
|
||||
order.Weight += sku.Weight * sku.Count
|
||||
}
|
||||
return order
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user