From 4fadebfea0d9895e9986b1645bb6ebb8fa7a9437 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=AD=90=E9=93=AD?= Date: Mon, 17 Mar 2025 09:49:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8B=93=E5=B1=95=E5=8F=82=E6=95=B0=E5=AD=97?= =?UTF-8?q?=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/biz/cmb.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/internal/biz/cmb.go b/internal/biz/cmb.go index acd2635..8cc21ba 100644 --- a/internal/biz/cmb.go +++ b/internal/biz/cmb.go @@ -125,9 +125,6 @@ func (v *VoucherBiz) CmbProductQuery(ctx context.Context, productNo string) (rep EndTime: *wechatResp.AvailableEndTime, AvailableStock: "", Detail: *wechatResp.Description, - - SaleStartTime: *wechatResp.StartTime, - SaleEndTime: *wechatResp.StopTime, } reps.Amount = fmt.Sprintf("%d", *wechatResp.StockUseRule.FixedNormalCoupon.CouponAmount) @@ -136,6 +133,13 @@ func (v *VoucherBiz) CmbProductQuery(ctx context.Context, productNo string) (rep availableStock := *wechatResp.StockUseRule.MaxCoupons - *wechatResp.DistributedCoupons reps.AvailableStock = fmt.Sprintf("%d", availableStock) + if wechatResp.StartTime != nil { + reps.SaleStartTime = *wechatResp.StartTime + } + if wechatResp.StopTime != nil { + reps.SaleEndTime = *wechatResp.StopTime + } + reps.AvailableType = vo.CmbAvailableTypeFixed.GetValue() return nil