作者 tangxvhui

bug 修复

... ... @@ -465,6 +465,7 @@ func (service OrderInfoService) Delivery(cmd command.OrderDeliveryCommand) error
}
oldOrderData.DeliveryCode = cmd.DeliveryCode
oldOrderData.DeliveryTime = time.Now()
oldOrderData.Goods = oldOrderGoods
//变更订单类型
oldOrderData.OrderType = domain.OrderReal
err = oldOrderData.Compute()
... ...
... ... @@ -66,15 +66,15 @@ type OrderBase struct {
var _ pg.BeforeUpdateHook = (*OrderBase)(nil)
func (or *OrderBase) BeforeUpdate(ctx context.Context) (context.Context, error) {
or.UpdateTime = time.Now()
func (order *OrderBase) BeforeUpdate(ctx context.Context) (context.Context, error) {
order.UpdateTime = time.Now()
return ctx, nil
}
var _ pg.BeforeInsertHook = (*OrderBase)(nil)
func (or *OrderBase) BeforeInsert(ctx context.Context) (context.Context, error) {
or.CreateTime = time.Now()
or.UpdateTime = time.Now()
func (order *OrderBase) BeforeInsert(ctx context.Context) (context.Context, error) {
order.CreateTime = time.Now()
order.UpdateTime = time.Now()
return ctx, nil
}
... ...
... ... @@ -40,6 +40,7 @@ func (reponsitory OrderBaseRepository) transformPgModelToDomainModel(orderModel
PartnerInfo: domain.Partner{
Id: orderModel.PartnerId,
},
BonusStatus: orderModel.BonusStatus,
}
return order, nil
}
... ... @@ -59,6 +60,7 @@ func (repository OrderBaseRepository) Save(orderInfo *domain.OrderBase) error {
PlanPartnerBonus: orderInfo.OrderCompute.PlanPartnerBonus, UsePartnerBonus: orderInfo.OrderCompute.UsePartnerBonus,
PartnerBonusHas: orderInfo.OrderCompute.PartnerBonusHas, PartnerBonusNot: orderInfo.OrderCompute.PartnerBonusNot,
PartnerBonusExpense: orderInfo.OrderCompute.PartnerBonusExpense, IsDisable: orderInfo.IsDisable,
CreateTime: orderInfo.CreateTime, BonusStatus: orderInfo.BonusStatus,
}
if m.Id == 0 {
_, err = tx.Model(m).
... ...