售前售后扣点订单钱修改
This commit is contained in:
@@ -131,6 +131,11 @@ func (c *OrderManager) OnOrderAdjust(order *model.GoodsOrder, orderStatus *model
|
||||
// return err
|
||||
// }, "OnAdjustOrder delete order_sku, orderID:%s", order.VendorOrderID)
|
||||
order.AdjustCount = adjustCount + 1
|
||||
//扣点的订单需要修改订单的totalshopmoney
|
||||
if err == nil && order.EarningType == model.EarningTypePoints {
|
||||
order2, _ := partner.GetPurchaseOrderHandlerFromVendorID(order.VendorID).GetOrder(order.VendorOrgCode, order.VendorOrderID)
|
||||
order.TotalShopMoney = order2.TotalShopMoney
|
||||
}
|
||||
isDuplicated, err = c.SaveOrder(order, true, db)
|
||||
}
|
||||
if err == nil {
|
||||
@@ -1702,7 +1707,10 @@ func AdjustJdsOrderSimple(ctx *jxcontext.Context, vendorOrderID string, skuID in
|
||||
)
|
||||
orderSkus, err := dao.GetSimpleOrderSkus(db, vendorOrderID, []int{skuID})
|
||||
order, err := dao.GetSimpleOrder(db, vendorOrderID)
|
||||
|
||||
//如果不是商城模板店
|
||||
if jxutils.GetSaleStoreIDFromOrder(order) != model.JdShopMainStoreID {
|
||||
return fmt.Errorf("目前只支持商城模板店的简单售前删除!")
|
||||
}
|
||||
orderSkus2, err := dao.GetSimpleOrderSkus(db, vendorOrderID, nil)
|
||||
if len(orderSkus2) == 1 {
|
||||
return fmt.Errorf("这一单只剩这最后一个商品了,不允许删除!")
|
||||
@@ -1720,6 +1728,7 @@ func AdjustJdsOrderSimple(ctx *jxcontext.Context, vendorOrderID string, skuID in
|
||||
} else {
|
||||
_, err = dao.DeleteEntity(db, orderSku)
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user