fix
This commit is contained in:
parent
e23ee6518d
commit
600a6edd7b
|
@ -73,10 +73,13 @@ func (l *CalculateProductPriceLogic) CalculateProductPrice(req *types.CalculateP
|
||||||
fittingPrice := int64(0)
|
fittingPrice := int64(0)
|
||||||
if req.FittingId > 0 {
|
if req.FittingId > 0 {
|
||||||
fittingInfo, err := l.svcCtx.AllModels.FsProductModel3d.FindOne(l.ctx, req.FittingId, "id,price")
|
fittingInfo, err := l.svcCtx.AllModels.FsProductModel3d.FindOne(l.ctx, req.FittingId, "id,price")
|
||||||
|
if err != nil {
|
||||||
if errors.Is(err, gorm.ErrRecordNotFound) {
|
if errors.Is(err, gorm.ErrRecordNotFound) {
|
||||||
return resp.SetStatusWithMessage(basic.CodeDbRecordNotFoundErr, "fitting info is not exists")
|
return resp.SetStatusWithMessage(basic.CodeDbRecordNotFoundErr, "fitting info is not exists")
|
||||||
}
|
}
|
||||||
|
logx.Error(err)
|
||||||
return resp.SetStatusWithMessage(basic.CodeDbSqlErr, "failed to get fitting info")
|
return resp.SetStatusWithMessage(basic.CodeDbSqlErr, "failed to get fitting info")
|
||||||
|
}
|
||||||
fittingPrice = *fittingInfo.Price
|
fittingPrice = *fittingInfo.Price
|
||||||
}
|
}
|
||||||
totalPrice, itemPrice, err := step_price.GetNewCentStepPrice(req.PurchaseQuantity, stepPrice, fittingPrice)
|
totalPrice, itemPrice, err := step_price.GetNewCentStepPrice(req.PurchaseQuantity, stepPrice, fittingPrice)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user