1、完善订单退款时间

2、完善微信支付开通代理会员失败退款
This commit is contained in:
2025-05-11 23:43:01 +08:00
parent 972b10eeae
commit 16e57387db
2 changed files with 83 additions and 19 deletions

View File

@@ -2,6 +2,7 @@ package queue
import (
"context"
"database/sql"
"encoding/hex"
"encoding/json"
"fmt"
@@ -13,6 +14,7 @@ import (
"qnc-server/pkg/lzkit/lzUtils"
"regexp"
"strings"
"time"
"github.com/hibiken/asynq"
"github.com/zeromicro/go-zero/core/logx"
@@ -181,6 +183,10 @@ func (l *PaySuccessNotifyUserHandler) handleError(ctx context.Context, err error
logx.Errorf("支付宝退款成功, orderID: %d", order.Id)
// 更新订单状态为退款
order.Status = "refunded"
order.RefundTime = sql.NullTime{
Time: time.Now(),
Valid: true,
}
updateOrderErr := l.svcCtx.OrderModel.UpdateWithVersion(ctx, nil, order)
if updateOrderErr != nil {
logx.Errorf("更新订单状态失败订单ID: %d, 错误: %v", order.Id, updateOrderErr)