fix
This commit is contained in:
@@ -107,7 +107,7 @@ func (l *UserAgainOrderLogic) UserAgainOrder(req *types.UserAgainOrderReq, useri
|
||||
}
|
||||
cartInfo, err := cartModel.FindOneCartByParams(l.ctx, cartReq)
|
||||
if err == nil && (err != nil && errors.Is(err, gorm.ErrRecordNotFound)) {
|
||||
now := time.Now().Unix()
|
||||
now := time.Now().UTC().Unix()
|
||||
nowTime := time.Now()
|
||||
data := gmodel.FsCart{
|
||||
UserId: &userinfo.UserId,
|
||||
|
||||
@@ -94,7 +94,7 @@ func (l *UserOderDeleteLogic) UserOderDelete(req *types.RequestOrderId, userinfo
|
||||
|
||||
var (
|
||||
IsRefund int64 = 0
|
||||
CreatedAt = time.Now().Unix()
|
||||
CreatedAt = time.Now().UTC().Unix()
|
||||
)
|
||||
|
||||
refund := &gmodel.FsRefundReason{
|
||||
|
||||
@@ -61,7 +61,7 @@ func (l *UserOrderCancelLogic) UserOrderCancel(req *types.UserOrderCancelReq, us
|
||||
return resp.SetStatusWithMessage(basic.CodeOrderNotCancelledErr, "the order status not cancle")
|
||||
}
|
||||
|
||||
var cancelTime int64 = time.Now().Unix() - (*orderInfo.Ctime + int64(constants.CANCLE_ORDER_EXPIRE))
|
||||
var cancelTime int64 = time.Now().UTC().Unix() - (*orderInfo.Ctime + int64(constants.CANCLE_ORDER_EXPIRE))
|
||||
// 第一次支付成功后48小时后不能进行取消操作
|
||||
if *orderInfo.IsPayCompleted == 1 && cancelTime > 0 {
|
||||
return resp.SetStatusWithMessage(basic.CodeOrderNotCancelledErr, "The current order cannot be cancelled")
|
||||
@@ -73,7 +73,7 @@ func (l *UserOrderCancelLogic) UserOrderCancel(req *types.UserOrderCancelReq, us
|
||||
orderInfo.RefundReasonId = &req.RefundReasonId
|
||||
orderInfo.RefundReason = &req.RefundReason
|
||||
|
||||
var nowTime = time.Now().Unix()
|
||||
var nowTime = time.Now().UTC().Unix()
|
||||
var payList []handlers.PayInfo
|
||||
// 事务处理
|
||||
ctx := l.ctx
|
||||
|
||||
@@ -158,7 +158,7 @@ func (l *UserOrderListLogic) UserOrderList(req *types.UserOrderListReq, userinfo
|
||||
|
||||
//如果是部分支付状态,那么取消订单倒计时2天
|
||||
if *item.Status == int64(constants.STATUS_NEW_PART_PAY) {
|
||||
surplusAt = (*item.Ctime + int64(constants.CANCLE_ORDER_EXPIRE)) - time.Now().Unix()
|
||||
surplusAt = (*item.Ctime + int64(constants.CANCLE_ORDER_EXPIRE)) - time.Now().UTC().Unix()
|
||||
if surplusAt < 0 {
|
||||
surplusAt = 0
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user