This commit is contained in:
wucongxing8150 2024-09-09 17:07:40 +08:00
parent fc4e40f49b
commit 508976a93c

View File

@ -115,7 +115,7 @@ func (r *OrderSingleService) AddOrderSingle(tx *gorm.DB, UserId, QuestionId int6
}
if orderPrice == nil {
return nil, errors.New("价格异常")
return nil, errors.New("价格异常1")
}
// 实际付款金额
@ -125,10 +125,6 @@ func (r *OrderSingleService) AddOrderSingle(tx *gorm.DB, UserId, QuestionId int6
paymentAmountTotal = 0
}
if *orderPrice != paymentAmountTotal {
return nil, errors.New("价格异常")
}
// 会员支付/0元支付
if payChannel == 3 || paymentAmountTotal == 0 {
paymentAmountTotal = 0 // 实际付款金额
@ -152,6 +148,10 @@ func (r *OrderSingleService) AddOrderSingle(tx *gorm.DB, UserId, QuestionId int6
singleValidDate := model.LocalTime(time.Now().Add(time.Duration(systemSingle.ValidDays) * 24 * time.Hour))
validDate = &singleValidDate
} else {
if *orderPrice != paymentAmountTotal {
return nil, errors.New("价格异常")
}
orderStatus = 1 // 订单状态1:待支付 2:已完成 3:已取消)
payStatus = 1 // 支付状态1:未支付 2:已支付 3:支付中 4:支付失败 5:支付超时 6:支付关闭 7:已撤销 8:转入退款)
payTime = nil // 支付时间