fix:合图调整

This commit is contained in:
momo 2023-10-07 11:48:53 +08:00
parent c2f61fc61a
commit 8d987c4c54
2 changed files with 8 additions and 2 deletions

View File

@ -1016,8 +1016,13 @@ func (d *defaultOrder) Create(ctx context.Context, in *CreateReq) (res *CreateRe
return errors.New("shoppingCartProductModel3d.StepPrice nil") return errors.New("shoppingCartProductModel3d.StepPrice nil")
} }
var fittingPrice int64
if shoppingCart.ShoppingCartProductModel3dFitting != nil {
fittingPrice = *shoppingCart.ShoppingCartProductModel3dFitting.Price
}
/* 计算价格 */ /* 计算价格 */
productTotalPrice, productPrice, err := NewShoppingCart(tx, nil, nil).CaculateStepPrice(*shoppingCart.PurchaseQuantity, stepPriceJson, *shoppingCart.ShoppingCartProductModel3dFitting.Price) productTotalPrice, productPrice, err := NewShoppingCart(tx, nil, nil).CaculateStepPrice(*shoppingCart.PurchaseQuantity, stepPriceJson, fittingPrice)
if err != nil { if err != nil {
errorCode = *basic.CodeErrOrderCreatProductPriceAbsent errorCode = *basic.CodeErrOrderCreatProductPriceAbsent
errorCode.Message = "create order failed, step price of product '" + shoppingCartSnapshot.ProductInfo.ProductName + "'is failed" errorCode.Message = "create order failed, step price of product '" + shoppingCartSnapshot.ProductInfo.ProductName + "'is failed"

View File

@ -5,9 +5,10 @@ import (
"errors" "errors"
"fusenapi/model/gmodel" "fusenapi/model/gmodel"
"fusenapi/utils/hash" "fusenapi/utils/hash"
"strings"
"github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/aws/session"
"gorm.io/gorm" "gorm.io/gorm"
"strings"
) )
func NewShoppingCart(gormDB *gorm.DB, bLMServiceUrl *string, awsSession *session.Session) ShoppingCart { func NewShoppingCart(gormDB *gorm.DB, bLMServiceUrl *string, awsSession *session.Session) ShoppingCart {