orderInfo:
id final_total_amount original_total_amount
--------------------------------------------------------------------------------
1
orderDetail:
id order_id order_price sku_num
-------------------------------------------------------------------------------------------
100 1
200 1
300 1
如何判断是否是首单呢?
if(order_price*sku_num == original_total_amount - ∑已经处理的订单明细原始金额(即:每个订单明细的order_price*sku_num))
∑通过什么来存呢? Redis K=>String V=>String
if(不是最后一单){
实付金额为 = final_total_amount * ((order_price*sku_num)/original_total_amount)
}else{
实付金额为 = final_total_amount - ∑已经处理的订单明细实付金额
}
原文:https://www.cnblogs.com/zlshtml/p/13714804.html