作者 tangxvhui

bug 修复

@@ -465,6 +465,7 @@ func (service OrderInfoService) Delivery(cmd command.OrderDeliveryCommand) error @@ -465,6 +465,7 @@ func (service OrderInfoService) Delivery(cmd command.OrderDeliveryCommand) error
465 } 465 }
466 oldOrderData.DeliveryCode = cmd.DeliveryCode 466 oldOrderData.DeliveryCode = cmd.DeliveryCode
467 oldOrderData.DeliveryTime = time.Now() 467 oldOrderData.DeliveryTime = time.Now()
  468 + oldOrderData.Goods = oldOrderGoods
468 //变更订单类型 469 //变更订单类型
469 oldOrderData.OrderType = domain.OrderReal 470 oldOrderData.OrderType = domain.OrderReal
470 err = oldOrderData.Compute() 471 err = oldOrderData.Compute()
@@ -66,15 +66,15 @@ type OrderBase struct { @@ -66,15 +66,15 @@ type OrderBase struct {
66 66
67 var _ pg.BeforeUpdateHook = (*OrderBase)(nil) 67 var _ pg.BeforeUpdateHook = (*OrderBase)(nil)
68 68
69 -func (or *OrderBase) BeforeUpdate(ctx context.Context) (context.Context, error) {  
70 - or.UpdateTime = time.Now() 69 +func (order *OrderBase) BeforeUpdate(ctx context.Context) (context.Context, error) {
  70 + order.UpdateTime = time.Now()
71 return ctx, nil 71 return ctx, nil
72 } 72 }
73 73
74 var _ pg.BeforeInsertHook = (*OrderBase)(nil) 74 var _ pg.BeforeInsertHook = (*OrderBase)(nil)
75 75
76 -func (or *OrderBase) BeforeInsert(ctx context.Context) (context.Context, error) {  
77 - or.CreateTime = time.Now()  
78 - or.UpdateTime = time.Now() 76 +func (order *OrderBase) BeforeInsert(ctx context.Context) (context.Context, error) {
  77 + order.CreateTime = time.Now()
  78 + order.UpdateTime = time.Now()
79 return ctx, nil 79 return ctx, nil
80 } 80 }
@@ -40,6 +40,7 @@ func (reponsitory OrderBaseRepository) transformPgModelToDomainModel(orderModel @@ -40,6 +40,7 @@ func (reponsitory OrderBaseRepository) transformPgModelToDomainModel(orderModel
40 PartnerInfo: domain.Partner{ 40 PartnerInfo: domain.Partner{
41 Id: orderModel.PartnerId, 41 Id: orderModel.PartnerId,
42 }, 42 },
  43 + BonusStatus: orderModel.BonusStatus,
43 } 44 }
44 return order, nil 45 return order, nil
45 } 46 }
@@ -59,6 +60,7 @@ func (repository OrderBaseRepository) Save(orderInfo *domain.OrderBase) error { @@ -59,6 +60,7 @@ func (repository OrderBaseRepository) Save(orderInfo *domain.OrderBase) error {
59 PlanPartnerBonus: orderInfo.OrderCompute.PlanPartnerBonus, UsePartnerBonus: orderInfo.OrderCompute.UsePartnerBonus, 60 PlanPartnerBonus: orderInfo.OrderCompute.PlanPartnerBonus, UsePartnerBonus: orderInfo.OrderCompute.UsePartnerBonus,
60 PartnerBonusHas: orderInfo.OrderCompute.PartnerBonusHas, PartnerBonusNot: orderInfo.OrderCompute.PartnerBonusNot, 61 PartnerBonusHas: orderInfo.OrderCompute.PartnerBonusHas, PartnerBonusNot: orderInfo.OrderCompute.PartnerBonusNot,
61 PartnerBonusExpense: orderInfo.OrderCompute.PartnerBonusExpense, IsDisable: orderInfo.IsDisable, 62 PartnerBonusExpense: orderInfo.OrderCompute.PartnerBonusExpense, IsDisable: orderInfo.IsDisable,
  63 + CreateTime: orderInfo.CreateTime, BonusStatus: orderInfo.BonusStatus,
62 } 64 }
63 if m.Id == 0 { 65 if m.Id == 0 {
64 _, err = tx.Model(m). 66 _, err = tx.Model(m).