fix err return
This commit is contained in:
parent
27e50ded04
commit
f1728bb5a3
|
@ -2452,13 +2452,13 @@ func (v *Vas) RefundOrder(ctx *gin.Context, req *vasproto.RefundOrderReq) error
|
|||
// 获取订单
|
||||
order, err := v.store.GetOrderById(ctx, nil, req.OrderId)
|
||||
if err == sql.ErrNoRows {
|
||||
return errs.ErrVasOrderNotExists
|
||||
return errors.New("订单不存在")
|
||||
}
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if order == nil {
|
||||
return errs.ErrVasOrderNotExists
|
||||
return errors.New("订单不存在")
|
||||
}
|
||||
|
||||
// 获取商品
|
||||
|
@ -2478,7 +2478,7 @@ func (v *Vas) RefundOrder(ctx *gin.Context, req *vasproto.RefundOrderReq) error
|
|||
case dbstruct.ProductTypeMoneyContact:
|
||||
return v.refundMoneyContactWechat(ctx, order, req)
|
||||
default:
|
||||
return errors.New("invalid product")
|
||||
return errors.New("不支持该商品退款")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2966,7 +2966,7 @@ func (v *Vas) RefundCoinOrder(ctx *gin.Context, req *vasproto.RefundCoinOrderReq
|
|||
// 获取订单
|
||||
order, err := v.store.GetCoinOrderById(ctx, nil, req.OrderId)
|
||||
if err == sql.ErrNoRows {
|
||||
return errs.ErrVasOrderNotExists
|
||||
return errors.New("订单不存在")
|
||||
}
|
||||
if err != nil {
|
||||
return err
|
||||
|
@ -2979,7 +2979,7 @@ func (v *Vas) RefundCoinOrder(ctx *gin.Context, req *vasproto.RefundCoinOrderReq
|
|||
case dbstruct.ProductIdContactWechat:
|
||||
return v.refundCoinContactWechat(ctx, order, req)
|
||||
default:
|
||||
return errors.New("invalid product")
|
||||
return errors.New("不支持该商品退款")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue