|
@@ -86,14 +86,14 @@ func CreateProductOrder(templateUser user.User, productId int, orderNo string) (
|
|
|
var exisitOrder orderService.ProductOrderDTO
|
|
|
exisitOrder, err = orderService.GetUserOrderByProduct(productId, templateUser.Id)
|
|
|
if (err != nil && !errors.Is(err, gorm.ErrRecordNotFound)) || exisitOrder.Status == productOrderStatusMap[orderDao.OrderStatusPending] {
|
|
|
- err = exception.NewWithException(exception.SubscribeFailed, "当前产品有正在进行中的订单,请勿重复下单")
|
|
|
+ err = exception.NewWithException(exception.DuplicateSubscribe, "当前产品有正在进行中的订单,请勿重复下单")
|
|
|
return
|
|
|
}
|
|
|
//是否在有效期的产品
|
|
|
var access merchantService.UserAccessDTO
|
|
|
access, err = merchantService.GetUserSubscribe(templateUser.Id, productId)
|
|
|
if (err != nil && !errors.Is(err, gorm.ErrRecordNotFound)) || access.Status == accessStatusMap[merchantDao.SubscribeValid] {
|
|
|
- err = exception.NewWithException(exception.SubscribeFailed, "当前产品已订阅,请勿重复下单")
|
|
|
+ err = exception.NewWithException(exception.DuplicateSubscribe, "当前产品已订阅,请勿重复下单")
|
|
|
return
|
|
|
}
|
|
|
orderNo, err = orderService.CreateProductOrder(orderService.ProductOrderDTO{
|