This commit is contained in:
@@ -183,6 +183,9 @@ func (s *Service) GetPurchasePrice(ctx context.Context, pkg *model.Package, sell
|
||||
if sellerShopID > 0 {
|
||||
allocation, err := s.packageAllocationStore.GetByShopAndPackageForSystem(ctx, sellerShopID, pkg.ID)
|
||||
if err != nil {
|
||||
if err == gorm.ErrRecordNotFound {
|
||||
return 0, errors.New(errors.CodeInvalidParam, "套餐已下架")
|
||||
}
|
||||
return 0, errors.Wrap(errors.CodeInternalError, err, "查询套餐分配记录失败")
|
||||
}
|
||||
return allocation.RetailPrice, nil
|
||||
@@ -198,6 +201,9 @@ func (s *Service) GetCostPrice(ctx context.Context, pkg *model.Package, sellerSh
|
||||
}
|
||||
allocation, err := s.packageAllocationStore.GetByShopAndPackageForSystem(ctx, sellerShopID, pkg.ID)
|
||||
if err != nil {
|
||||
if err == gorm.ErrRecordNotFound {
|
||||
return 0, errors.New(errors.CodeInvalidParam, "店铺没有该套餐的分配配置")
|
||||
}
|
||||
return 0, errors.Wrap(errors.CodeInternalError, err, "查询套餐分配记录失败")
|
||||
}
|
||||
return allocation.CostPrice, nil
|
||||
|
||||
Reference in New Issue
Block a user