diff --git a/internal/biz/wechat_notify.go b/internal/biz/wechat_notify.go index 0e59972..14eccc0 100644 --- a/internal/biz/wechat_notify.go +++ b/internal/biz/wechat_notify.go @@ -52,6 +52,19 @@ func (v *VoucherBiz) useLog(ctx context.Context, order *bo.OrderBo, req *bo.Wech return nil } + if req.PlainText.ConsumeInformation.ConsumeAmount > 0 { + if err := v.createUseLog(ctx, order, req); err != nil { + return err + } + } + + _ = v.wxToBBUse(ctx, order, req) + + return nil +} + +func (v *VoucherBiz) createUseLog(ctx context.Context, order *bo.OrderBo, req *bo.WechatVoucherNotifyBo) error { + useTime, err2 := time.Parse(time.RFC3339, req.PlainText.ConsumeInformation.ConsumeTime) if err2 != nil { return err2 @@ -74,9 +87,6 @@ func (v *VoucherBiz) useLog(ctx context.Context, order *bo.OrderBo, req *bo.Wech return err } } - - _ = v.wxToBBUse(ctx, order, req) - return nil }