This commit is contained in:
Mrx
2026-01-27 18:44:29 +08:00
parent f867e603f0
commit b71ef1cbd9
2 changed files with 12 additions and 9 deletions

View File

@@ -214,14 +214,16 @@ func (l *PaymentLogic) QueryOrderPayment(req *types.PaymentReq, session sqlx.Ses
if encryptErr != nil {
return nil, errors.Wrapf(xerr.NewErrCode(xerr.SERVER_COMMON_ERROR), "生成订单, 加密身份证号失败: %v", encryptErr)
}
// 查询72小时内的查询次数
queryCount, countErr := l.svcCtx.QueryUserRecordModel.CountByEncryptedIdCardIn72Hours(l.ctx, encryptedIdCard)
if countErr != nil {
return nil, errors.Wrapf(xerr.NewErrCode(xerr.DB_ERROR), "生成订单, 查询记录失败: %v", countErr)
}
// 如果72小时内查询次数大于等于2次禁止支付当前这次是第3次
if queryCount >= 2 {
return nil, errors.Wrapf(xerr.NewErrMsg("查询受限通知检测到您72小时内已完成2次报告查询系统已自动暂停服务。如需紧急查询请联系客服申请临时额度。"), "生成订单, 查询次数超限: %d", queryCount)
// 查询72小时内的查询次数(仅对代理渠道订单进行限制)
if data.AgentIdentifier != "" {
queryCount, countErr := l.svcCtx.QueryUserRecordModel.CountByEncryptedIdCardIn72Hours(l.ctx, encryptedIdCard)
if countErr != nil {
return nil, errors.Wrapf(xerr.NewErrCode(xerr.DB_ERROR), "生成订单, 查询记录失败: %v", countErr)
}
// 如果72小时内查询次数大于等于2次禁止支付当前这次是第3次
if queryCount >= 2 {
return nil, errors.Wrapf(xerr.NewErrMsg("查询受限通知检测到您72小时内已完成2次报告查询系统已自动暂停服务。如需紧急查询请联系客服申请临时额度。"), "生成订单, 查询次数超限: %d", queryCount)
}
}
var orderID int64