This commit is contained in:
ziming 2025-05-21 17:34:57 +08:00
parent ef26d56c56
commit b8eb1208d0
1 changed files with 20 additions and 15 deletions

View File

@ -105,13 +105,16 @@ func (v *VoucherBiz) order(ctx context.Context, req *bo.OrderCreateReqBo, produc
return nil, err return nil, err
} }
voucherNo, err := v.WechatCpnRepo.Order(ctx, order) //voucherNo, err := v.WechatCpnRepo.Order(ctx, order)
if err != nil { //if err != nil {
if err3 := v.fail(ctx, order, err); err3 != nil { // if err3 := v.fail(ctx, order, err); err3 != nil {
return nil, err3 // return nil, err3
} // }
return nil, err // return nil, err
} //}
// mock发券成功,测试使用
voucherNo := order.OrderNo
if err = v.success(ctx, order, voucherNo); err != nil { if err = v.success(ctx, order, voucherNo); err != nil {
return order, err return order, err
@ -122,14 +125,16 @@ func (v *VoucherBiz) order(ctx context.Context, req *bo.OrderCreateReqBo, produc
func (v *VoucherBiz) orderRetry(ctx context.Context, order *bo.OrderBo) error { func (v *VoucherBiz) orderRetry(ctx context.Context, order *bo.OrderBo) error {
voucherNo, err := v.WechatCpnRepo.Order(ctx, order) // mock发券成功,测试使用
voucherNo := order.OrderNo
if err != nil { //voucherNo, err := v.WechatCpnRepo.Order(ctx, order)
if err3 := v.fail(ctx, order, err); err3 != nil { //
return err3 //if err != nil {
} // if err3 := v.fail(ctx, order, err); err3 != nil {
return err // return err3
} // }
// return err
//}
return v.success(ctx, order, voucherNo) return v.success(ctx, order, voucherNo)
} }