增加原价字段
This commit is contained in:
@@ -392,6 +392,7 @@ type PriceDefendOrder struct {
|
|||||||
AddressID int64 `orm:"column(address_id)" json:"addressID"`
|
AddressID int64 `orm:"column(address_id)" json:"addressID"`
|
||||||
Count int `json:"count"`
|
Count int `json:"count"`
|
||||||
DefendPrice int64 `json:"defendPrice"` //守的价格
|
DefendPrice int64 `json:"defendPrice"` //守的价格
|
||||||
|
OriginPrice int64 `json:"originPrice"` //商品原价
|
||||||
ActualPayPrice int64 `json:"actualPayPrice"` //单位为分 顾客实际支付
|
ActualPayPrice int64 `json:"actualPayPrice"` //单位为分 顾客实际支付
|
||||||
RealPrice int64 `json:"realPrice"` //实际成交价
|
RealPrice int64 `json:"realPrice"` //实际成交价
|
||||||
IsBuyNowPrice int `json:"isBuyNowPrice"` //库存剩x(x=当前客户购买的数量)时以当时价抢购
|
IsBuyNowPrice int `json:"isBuyNowPrice"` //库存剩x(x=当前客户购买的数量)时以当时价抢购
|
||||||
|
|||||||
@@ -64,6 +64,8 @@ type JxSkuInfo struct {
|
|||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Weight int `json:"weight"`
|
Weight int `json:"weight"`
|
||||||
GroupSign bool `json:"groupSign"`
|
GroupSign bool `json:"groupSign"`
|
||||||
|
|
||||||
|
DefendPrice int64 `json:"defendPrice"` //守价
|
||||||
}
|
}
|
||||||
|
|
||||||
type JxSkuInfo2 struct {
|
type JxSkuInfo2 struct {
|
||||||
@@ -274,14 +276,15 @@ func buildDefendPriceOrder(ctx *jxcontext.Context, jxOrder *JxOrderInfo, address
|
|||||||
SkuID: jxOrder.Skus[0].SkuID,
|
SkuID: jxOrder.Skus[0].SkuID,
|
||||||
AddressID: addressID,
|
AddressID: addressID,
|
||||||
Count: jxOrder.Skus[0].Count,
|
Count: jxOrder.Skus[0].Count,
|
||||||
DefendPrice: jxOrder.Skus[0].Price,
|
DefendPrice: jxOrder.Skus[0].DefendPrice,
|
||||||
|
OriginPrice: jxOrder.Skus[0].Price,
|
||||||
IsBuyNowPrice: jxOrder.IsBuyNowPrice,
|
IsBuyNowPrice: jxOrder.IsBuyNowPrice,
|
||||||
Issue: issue,
|
Issue: issue,
|
||||||
IsSuccess: model.NO, //默认是不成功
|
IsSuccess: model.NO, //默认是不成功
|
||||||
IsPay: model.NO,
|
IsPay: model.NO,
|
||||||
}
|
}
|
||||||
dao.WrapAddIDCULDEntity(priceDefendOrder, ctx.GetUserName())
|
dao.WrapAddIDCULDEntity(priceDefendOrder, ctx.GetUserName())
|
||||||
priceDefendOrder.ActualPayPrice = int64(priceDefendOrder.Count)*priceDefendOrder.DefendPrice + jxOrder.FreightPrice
|
priceDefendOrder.ActualPayPrice = int64(priceDefendOrder.Count)*jxOrder.Skus[0].Price + jxOrder.FreightPrice
|
||||||
dao.CreateEntity(db, priceDefendOrder)
|
dao.CreateEntity(db, priceDefendOrder)
|
||||||
return priceDefendOrder.VendorOrderID
|
return priceDefendOrder.VendorOrderID
|
||||||
}
|
}
|
||||||
@@ -2017,7 +2020,8 @@ func SettleDiscountActByPriceDefend(ctx *jxcontext.Context, order *model.PriceDe
|
|||||||
refundID := order.VendorOrderID
|
refundID := order.VendorOrderID
|
||||||
if orderPay.PayType == model.PayTypeTL {
|
if orderPay.PayType == model.PayTypeTL {
|
||||||
if !isFull {
|
if !isFull {
|
||||||
_, err = RefundOrderByTL(ctx, orderPay, refundID, int(order.ActualPayPrice-order.RealPrice), settleDiscountActRefundReason)
|
minusPrice := int(order.OriginPrice - order.RealPrice)
|
||||||
|
_, err = RefundOrderByTL(ctx, orderPay, refundID, order.Count*minusPrice, settleDiscountActRefundReason)
|
||||||
} else {
|
} else {
|
||||||
_, err = RefundOrderByTL(ctx, orderPay, refundID, int(order.ActualPayPrice), settleDiscountActRefundReason)
|
_, err = RefundOrderByTL(ctx, orderPay, refundID, int(order.ActualPayPrice), settleDiscountActRefundReason)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user