From 9c08acc97a47a75a4604a2fa45a95e638f815bf5 Mon Sep 17 00:00:00 2001 From: momo <1012651275@qq.com> Date: Tue, 26 Sep 2023 18:20:48 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E6=94=AF=E4=BB=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- service/repositories/order.go | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/service/repositories/order.go b/service/repositories/order.go index 4572f1e7..77fb950c 100644 --- a/service/repositories/order.go +++ b/service/repositories/order.go @@ -714,16 +714,18 @@ func (d *defaultOrder) Detail(ctx context.Context, in *DetailReq) (res *DetailRe } // 是否超时支付 - ctime := *order.Ctime - ctimeTimeOut := ctime.Add(30 * time.Minute).UTC().Unix() - ntimeTimeOut := time.Now().UTC().Unix() - if ctimeTimeOut < ntimeTimeOut { - errorCode = *basic.CodeErrOrderCreatePrePaymentTimeout - err = errors.New("order pay timeout") - logx.Errorf("order detail failed, err: %v", err) - return &DetailRes{ - ErrorCode: errorCode, - }, err + if *order.Status == int64(constants.ORDERSTATUSUNPAIDDEPOSIT) { + ctime := *order.Ctime + ctimeTimeOut := ctime.Add(30 * time.Minute).UTC().Unix() + ntimeTimeOut := time.Now().UTC().Unix() + if ctimeTimeOut < ntimeTimeOut { + errorCode = *basic.CodeErrOrderCreatePrePaymentTimeout + err = errors.New("order pay timeout") + logx.Errorf("order detail failed, err: %v", err) + return &DetailRes{ + ErrorCode: errorCode, + }, err + } } ress, err := d.OrderDetailHandler(ctx, &order, 1)